mvn dependency:copy-dependencies 删除版本
我正在使用“mvn dependency:copy-dependencies”来获取我的项目使用的依赖项的所有源。 我从命令行使用它,所以它看起来像这样:
mvn dependency:copy-dependencies -Dclassifier=sources -DincludeScope=compile
除了一个小问题之外,它工作正常:由于某种原因,该版本被这个插件删除了。因此,我得到的是 commons-logging-1.1.1-sources.jar,而不是 commons-logging-sources.jar
该文档说“stripVersion”参数应该影响此行为,但默认值是 false。此外,我尝试明确设置它,但没有帮助。
我正在使用 apache-maven-2.2.1 和 jdk1.6.0_21
谢谢, 塔洛格。
I'm using "mvn dependency:copy-dependencies" to get all sources of the dependencies my project uses.
I use it from command line, so it looks like this:
mvn dependency:copy-dependencies -Dclassifier=sources -DincludeScope=compile
It works fine except of a small problem: For some reason the version is removed by this plugin. So instead of commons-logging-1.1.1-sources.jar, I'm getting commons-logging-sources.jar
The documentation says that "stripVersion" argument should effect this behavior, but the default value is false. Moreover, I tried to set it explicitly and it didn't help.
I'm using apache-maven-2.2.1 with jdk1.6.0_21
Thanks,
Tarlog.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这很奇怪,你可以在源代码中看到(Mojo,父 Mojo< /a>, DependencyUtil) stripVersion 执行它所说的操作。
几种可能性:
a) 您使用的是当前版本的依赖插件吗?
配置您的 pom
或使用完全限定的目标名称:
b)
stripVersion
是 XML 配置中的参数名称。命令行版本是尝试使用它。
That's very strange, you can see in the source (Mojo, Parent Mojo, DependencyUtil) that stripVersion does what it says it does.
Several possibilities:
a) Are you using the current version of the dependencies plugin?
Either configure your pom
or use the fully qualified goal name:
b)
stripVersion
is the parameter name in XML configuration. The command line version isTry using that.
我找到了问题的根本原因。在...我的 pom 的父级的父级的父级的某处,stripVersion 设置为 true。
我不知道这一点,并且认为设置系统属性必须覆盖 xml。我什至尝试将此属性放入我的 pom 中,但仍然没有帮助。不知何故,父 pom 仍然占主导地位,所以我认为该属性不起作用。
当我使用 -X param 运行时,尽管我的配置没有改变,但我发现它没有改变,所以我开始挖掘父 poms,除非发现问题。
谢谢大家!
I found the root cause of a problem. Somewhere in the parent of parent of parent of ... my pom, stripVersion was set to true.
I didn't know about it and anyway thought that setting the system property must override the xml. I even tried to put this property in my pom and it still didn't help. Somehow, the parent pom stayed the dominant one, so I thought that the property doesn't work.
When I ran with -X param I saw it no changing despite my configuration, so I started digging in the parent poms unless I found the problem.
Thanks to everyone!