Maven deploy:deploy-file 由于附加到 jar 的版本/时间戳而未找到 [英] Maven deploy:deploy-file not found due to version/timestamp appended to jar

查看:24
本文介绍了Maven deploy:deploy-file 由于附加到 jar 的版本/时间戳而未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用带有快照的 deploy:deploy-file 时遇到问题,我想请教一些建议.

I'm having a problem using deploy:deploy-file with snapshots I'd like some advice on please.

我有 2 个项目;1) 基于 Ant 和 2) 另一个基于 Maven 的,它通过 Archiva 消耗其他项目的 jars.

I have 2 projects; 1) Ant based and 2) the other Maven based that consumes the jars of the other project via Archiva.

我已向 Ant 项目添加了一个目标,以便在迭代期间在每次成功构建时部署快照.

I've added a target to the Ant project to deploy snapshots on every successful build during our iteration.

问题是 Maven 项目找不到它们,因为依赖项的名称有一个 timestamp 像这样附加:

The problem is the Maven project cannot find them because the name of the dependency has a timestamp appended like so:

someJar-1.0-20100407.171211-1.jar

这是 Ant 目标:

<exec executable="${maven.bin}" dir="../lib">
  <arg value="deploy:deploy-file" />
  <arg value="-DgroupId=com.my.package" /><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> 

我有一个类似的 Ant 发布目标,这很好用.

I have a similar Ant target for releases and this works fine.

其他通过 mvn deploy 部署 snapshosts 的纯 Maven 项目工作正常.

Other pure Maven projects which deploy snapshosts via mvn deploy work fine.

有人知道我哪里出错了吗?

Does anyone know where I am going wrong?

谢谢

更新

找出答案,见下文.

推荐答案

想出了答案.

如您所见,在我的 Ant 目标中,我正在部署文件.然后我也做了同样的事情,但使用了 -tests jar.

In my Ant target I was deploying the file as you can see. I also then did the same thing but with the -tests jar.

这在 Archiva 中产生了 2 个快照,而不是您在执行 mvn deploy 时所期望的通常的 1 个.

This resulted in 2 snapshots in Archiva, not the usual 1 has you'd expect if you did mvn deploy.

因此无法找到非测试依赖,因为最新的快照是-test jar.

Therefore the non test dependency could not be found because the latest snapshot was the -test jar.

很高兴知道如何解决这个问题.

Would be great to know how to solve this problem.

在单个事务中将非基于 Maven 的模块 src 和测试 jar 部署到 Archiva

这篇关于Maven deploy:deploy-file 由于附加到 jar 的版本/时间戳而未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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