开发者

Avoid javadoc and sources downloading, when using Maven ant Tasks

I'm developing with Maven Ant Tasks support. When asking the repository to download desired libraries, it also downloads javadoc and source for each library. Is there a way to only download library jars?

Actual build.xml:

<artifact:dependencies settingsFile="${maven.settingsFile}" pomRefId="projectPom"
                       filesetId="dependency.fileset"
                       sourcesFilesetId="sources.dependency.fileset"
           开发者_开发知识库            javadocFilesetId="javadoc.dependency.fileset"
                       versionsId="dependency.versions">
        <remoteRepository refid="remote.repository" />
</artifact:dependencies>


As far as I know the src and javadoc downloads are off by default. There should be an option in your IDE or whatever tool you use for Maven.

Are your working with Eclipse?
In Eclipse you can find the option here:

Window > Preferences  > Maven

Then tick the checkboxes (or rather untick them) 'Download Artifact Sources/JavaDoc'.


That's strange. Most open source Maven modules don't have source and javadoc on the default "compile" Maven scope. Have you tried specifying a scope?

<artifact:dependencies filesetId="dependency.fileset" useScope="compile">
..

Alternatively you can also specify a "scope" attribute on each dependency.

Personally I use the ivy plugin for my Maven downloads. The same problem is solved by specifying the "default" or "compile" configuration mapping: ivy: prevent downloading sources and .txt files


Finally solved: just remove sourcesFilesetId and javadocFilesetId attributes if you don't need sources and javadoc jar libraries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜