Ivy repository with source and javadoc artifacts

in contrast to Maven an Ivy module can have multiple artifacts. Source and javadoc artifacts are generally identified by separate configurations. This works well for Maven modules, but for Ivy modules with multiple artifacts it becomes questionable. Instead Ivy uses a separate type attribute to identify source artifacts. Unfortunately Gradle seems to ignore the ivy type attribute and depends on a “source” configuration even for Ivy modules.

Looking at IvyRoundup, multi artifacts modules are quite common without any source or javadoc configuration. Thus I end up with many source and javadoc artifacts in my classpath. I found no solution except editing the Ivy modules manually.

Is there any way to drop the unwanted source artifacts using a special dependency handler or a resolutionStrategy?

Here is an other example using Gradles ivy-publish plugin. If I use this generated Ivy module with Gradle, I get the primary jar and the source jar as well on my classpath.

How is this supposed to work?


This still appears to be the problem. Any idea how to designate certain artifacts as ‘sources’ or ‘javadoc’ based on either ivy configuration name or type?

There is also an old jira which references the same situation: Dependency resolution of Ivy artifacts does not support [type] token · Issue #1386 · gradle/gradle · GitHub