在单个事务中将非基于 Maven 的模块 src 和测试 jar 部署到 Archiva
是否可以使用Maven部署:部署文件
或类似的方法将您的主src jar快照
和测试src jar快照
部署到Archiva
以便它产生单个条目?
目前我有一个 Ant
项目,其中包含我想要发布到 Archiva 的 jar,这就是我正在做的事情it:
<!--Main Src Jar-->
<exec executable="${maven.bin}" dir="../lib">
<arg value="deploy:deploy-file" />
<arg value="-DgroupId=com.xxx.gt" />
<arg value="-DartifactId=${ant.project.name}" />
<arg value="-Dversion=${manifest.implementation.version}-SNAPSHOT" />
<arg value="-Dpackaging=jar" />
<arg value="-Dfile=../lib/${ant.project.name}-${manifest.implementation.version}-SNAPSHOT.jar" />
<arg value="-Durl=http://archiva.xxx.com/archiva/repository/snapshots" />
<arg value="-DrepositoryId=snapshots" />
</exec>
<!--Test Src Jar-->
<exec executable="${maven.bin}" dir="../lib">
<arg value="deploy:deploy-file" />
<arg value="-DgroupId=com.xxx.gt" />
<arg value="-DartifactId=${ant.project.name}" />
<arg value="-Dversion=${manifest.implementation.version}-SNAPSHOT" />
<arg value="-Dpackaging=jar" />
<arg value="-Dfile=../lib/${ant.project.name}-${manifest.implementation.version}-SNAPSHOT-tests.jar" />
<arg value="-Durl=http://archiva.xxx.com/archiva/repository/snapshots" />
<arg value="-DrepositoryId=snapshots" />
<arg value="-Dclassifier=tests" />
</exec>
上面的 Ant 脚本将在 Archiva
上生成两个
快照,其中一个包含 main src jar
,另一个包含 test src jar
.
在典型的 Maven 项目上使用 mvn deploy 会将工件分组在一起。
非分组档案图像
每个部署都有一个 sanpshot 条目:deploy-file 命令
分组 Archiva Image
有一个 sanpshot 条目分组 src 和测试 jar。
这是我之前的帖子,这将有助于解释我如何做到这一点这一点。
如果有人知道如何解决这个问题,我将不胜感激。
谢谢
Is it possible to use Maven deploy:deploy-file
or similar to deploy your main src jar snapshot
and the test src jar snapshot
to Archiva
so that it results in a single entry?
Currently I have an Ant
project which has jars I want publishing to Archiva and here is how I am doing it:
<!--Main Src Jar-->
<exec executable="${maven.bin}" dir="../lib">
<arg value="deploy:deploy-file" />
<arg value="-DgroupId=com.xxx.gt" />
<arg value="-DartifactId=${ant.project.name}" />
<arg value="-Dversion=${manifest.implementation.version}-SNAPSHOT" />
<arg value="-Dpackaging=jar" />
<arg value="-Dfile=../lib/${ant.project.name}-${manifest.implementation.version}-SNAPSHOT.jar" />
<arg value="-Durl=http://archiva.xxx.com/archiva/repository/snapshots" />
<arg value="-DrepositoryId=snapshots" />
</exec>
<!--Test Src Jar-->
<exec executable="${maven.bin}" dir="../lib">
<arg value="deploy:deploy-file" />
<arg value="-DgroupId=com.xxx.gt" />
<arg value="-DartifactId=${ant.project.name}" />
<arg value="-Dversion=${manifest.implementation.version}-SNAPSHOT" />
<arg value="-Dpackaging=jar" />
<arg value="-Dfile=../lib/${ant.project.name}-${manifest.implementation.version}-SNAPSHOT-tests.jar" />
<arg value="-Durl=http://archiva.xxx.com/archiva/repository/snapshots" />
<arg value="-DrepositoryId=snapshots" />
<arg value="-Dclassifier=tests" />
</exec>
The above Ant script will result in two
snapshots on Archiva
, 1 with the main src jar
and the other with the test src jar
.
Using mvn deploy on a typical Maven project will group the artifacts together.
Non Grouped Archiva Image
Has a sanpshot entry per deploy:deploy-file command
Grouped Archiva Image
Has a single sanpshot entry grouping src and tests jars.
Here's my earlier post which will help explain how I got to this point.
If anyone knows how to solve this I'd appreciate it.
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 maven-deploy-plugin 已经发展了很多。现在可以在一次执行中部署多个文件。请参阅 http://maven.apache.org/ plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html 的描述。
I think that the maven-deploy-plugin has evolved a lot. Right now it is possible to deploy multiple files within a single execution. See http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html for the description.