使用 Maven ant 任务时避免下载 javadoc 和源代码
我正在使用 Maven Ant 任务支持进行开发。当要求存储库下载所需的库时,它还会下载每个库的 javadoc 和源代码。有没有办法只下载库jar?
实际的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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
据我所知,src 和 javadoc 下载默认是关闭。您的 IDE 或用于 Maven 的任何工具中应该有一个选项。
您正在使用 Eclipse 吗?
在 Eclipse 中,您可以在此处找到该选项:
然后勾选(或者取消勾选)“下载 Artifact Sources/JavaDoc”复选框。
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:
Then tick the checkboxes (or rather untick them) 'Download Artifact Sources/JavaDoc'.
这很奇怪。大多数开源 Maven 模块在默认“编译”Maven 范围内没有源代码和 javadoc。您是否尝试过指定范围?
或者,您也可以为每个依赖项指定一个“范围”属性。
就我个人而言,我使用 ivy 插件进行 Maven 下载。通过指定“默认”或“编译”配置映射可以解决相同的问题: ivy:阻止下载源代码和.txt 文件
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?
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
最后解决了:如果不需要源和javadoc jar库,只需删除sourcesFilesetId和javadocFilesetId属性即可。
Finally solved: just remove sourcesFilesetId and javadocFilesetId attributes if you don't need sources and javadoc jar libraries.