如何使用maven从subversion导出项目?
Maven 有一个名为 maven-scm-plugin 的插件,它可以与源控制系统交互。 根据文档,我应该能够导出这样的项目:
mvn scm:export -DconnectionUrl=scm:svn:svn://url... -DexportDirectory=./project-export
但是,当我使用 maven 2.0.9 运行此命令时,我从 maven 收到以下错误:
[INFO] Required goal not found: scm:export in org.apache.maven.plugins:maven-scm-plugin:1.0-beta-3
所以看来 beta-3 版本的插件没有有“导出”目标,但它是在 1.1 中添加的。 我的 Maven 存储库 (.m2\repository\org\apache\maven\plugins\maven-scm-plugin) 中确实有两个版本,但是 Maven 坚持使用旧的测试版本,当找不到“出口”目标。 如何强制maven使用1.1版本的scm插件? mvn scm:export命令是独立使用的,因此不需要配置POM文件。 谢谢!
Maven has a plugin called maven-scm-plugin, which can interact with source control systems. According to the documentation, I should be able to export a project like this:
mvn scm:export -DconnectionUrl=scm:svn:svn://url... -DexportDirectory=./project-export
However when I run this command with maven 2.0.9, I got the following error from maven:
[INFO] Required goal not found: scm:export in org.apache.maven.plugins:maven-scm-plugin:1.0-beta-3
So it seems the beta-3 version of the plugin doesn't have the "export" goal, but it was added in 1.1. I do have both versions in my maven repo (.m2\repository\org\apache\maven\plugins\maven-scm-plugin), however maven insists on using the old beta version, and errors out when it can't find the "export" goal. How can I force maven to use the 1.1 version of the scm plugin? The mvn scm:export command is used independently, so there is no POM file to configure. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自己找到了解决方案。在插件目录(.m2\repository\org\apache\maven\plugins\maven-scm-plugin)中,有一个名为maven-metadata-central.xml的文件。 我曾经将“1.0-beta-3”作为“latest”和“release”元素的值,这就是maven坚持使用这个旧版本的原因。 将它们更改为 1.1 后,我可以运行该命令。
Found the solution myself.. In the plugin directory (.m2\repository\org\apache\maven\plugins\maven-scm-plugin), there is a file called maven-metadata-central.xml. I used to have "1.0-beta-3" as the value for both the "latest" and "release" elements, and that's why maven insists on using this old version. After I changed them to 1.1, I was able to run the command.