Class JarSourceEntry

java.lang.Object
io.github.intisy.gradle.github.plugin.extension.JarSourceEntry

public class JarSourceEntry extends Object
A single sources { jar { } } entry: a direct jar URL to download and add to a native Gradle configuration, with no repository or git host involved.
 sources {
     jar {
         url = "https://nexus.internal/libs/foo-1.0.jar"
         header "Authorization", "Bearer ${myToken}"
         sha256 = "..."               // optional integrity check
         into = "implementation"      // native configuration; optional, default "implementation"
     }
 }
 
  • Constructor Details

    • JarSourceEntry

      public JarSourceEntry()
  • Method Details

    • setUrl

      public void setUrl(String url)
      Parameters:
      url - the exact URL to download a jar from.
    • getUrl

      public String getUrl()
      Returns:
      the exact URL to download a jar from, or null if not set.
    • setSha256

      public void setSha256(String sha256)
      Parameters:
      sha256 - the expected SHA-256 of the downloaded jar, hex-encoded, or null to skip integrity verification.
    • getSha256

      public String getSha256()
      Returns:
      the expected SHA-256 of the downloaded jar, hex-encoded, or null if not set.
    • setInto

      public void setInto(String into)
      Parameters:
      into - the native Gradle configuration the downloaded jar is added to. Defaults to "implementation".
    • getInto

      public String getInto()
      Returns:
      the native Gradle configuration the downloaded jar is added to.
    • header

      public void header(String name, String value)
      Adds a single request header (for example, an auth token) to send with the download.
      Parameters:
      name - the header name.
      value - the header value.
    • getHeaders

      public Map<String,String> getHeaders()
      Returns:
      every header added via header(String, String), in declaration order; never null, empty when none were added.