What's the purpose of adding an artifact to a depe...
# community-support
a
What's the purpose of adding an artifact to a dependency? I couldn't find a clear explanation. It doesn't seem to do anything. Setting the URL also seems strange. I couldn't find see any usage of
DependencyArtifact#getUrl
, except in tests. It doesn't look like the value is ever read.
Copy code
dependencies {
  "fooConf"("blah:blah:1.2.3") {
    artifact {
      url = "<https://example.com/bar.zip>"
    }
  }
}
v
You are not adding an artifact, you configure it. You can for example set the
classifier
. No idea whether the url would have an effect somewhere.
a
Calling
artifacts.clear()
before
artifact {}
makes it work as intended, so I guess either the Javadoc is outdated or there's a bug. https://github.com/gradle/gradle/issues/33781
v
Oh, ok, sorry. I learned in the past you configure the artifact, not add one. Send that was wrong.