在单个事务中将非基于Maven的模块src和测试jar部署到Archiva [英] Deploying non Maven based module src and tests jar to Archiva in a single transaction

查看:96
本文介绍了在单个事务中将非基于Maven的模块src和测试jar部署到Archiva的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Maven deploy:deploy-file或类似的方法将main src jar snapshottest src jar snapshot部署到Archiva以便results in a single entry?

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?

目前,我有一个Ant项目,该项目包含要发布到Archiva的jar,这是我的工作方式:

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>

上面的Ant脚本将在Archiva上生成two快照,其中一个使用main src jar快照,另一个使用test src jar.

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.

在典型的Maven项目上使用mvn部署会将工件组合在一起.

Using mvn deploy on a typical Maven project will group the artifacts together.

非分组的Archiva图像

每个deploys有一个sanpshot条目:deploy-file命令

Has a sanpshot entry per deploy:deploy-file command

分组的Archiva图像

有一个对sanrcshot条目进行分组的src并测试jar.

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.

谢谢

推荐答案

我认为maven-deploy-plugin已经发展了很多.现在,可以在一次执行中部署多个文件.参见 http://maven.apache.org/插件/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.

这篇关于在单个事务中将非基于Maven的模块src和测试jar部署到Archiva的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆