Maven deploy:deploy-file not found due to version/

2019-08-07 02:11发布

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

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

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

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

Here is the Ant target:

<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> 

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

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

Does anyone know where I am going wrong?

Thank You

Update

Figured out the answer, see below.

1条回答
对你真心纯属浪费
2楼-- · 2019-08-07 02:37

Figured out the answer.

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.

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

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.

see Deploying non Maven based module src and tests jar to Archiva in a single transaction

查看更多
登录 后发表回答