开发者

Avoid javadoc and sources downloading, when using Maven ant Tasks

开发者 https://www.devze.com 2023-01-16 05:14 出处:网络
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 j

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

精彩评论

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

关注公众号