Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

maven - How to use a dependency from nexus and pass a revision

On our Nexus server we have a library with version 1.0 and 2.0. I build my main Project with Gradle.

Actually I have a dependency entry in my gradle file to the library from nexus that use lib version 1.0. Everything is fine.

But now I need a Version 2.0 of our library. The Problem is that the POM File of Lib 2.0 on nexus, does not have a standard version Tag anymore with 2.0 in it. like

<groupId>...</groupId>
<articaftId>...</articaftId>

<version>2.0</version>

Instead their is this line

...
<version>${revision}</version> 
...

When update the dependency in my Gradle file to 2.0 and try to build my Gradle project with

gradle clean assemble

The build fails with this Message

   > Could not resolve com.company.print.lib:print-lib:2.0
     Required by:
         project :com.company.printservice
      > Could not com.company.print.lib:print-lib:2.0
         > inconsistent module metadata found. Descriptor: com.company.print.lib:print-lib:0.0.0-SNAPSHOT Errors: bad version: expected='2.0' found='0.0.0-SNAPSHOT'

How I can solve this? Do I need to pass the Revision ob gradle build?

question from:https://stackoverflow.com/questions/65937951/how-to-use-a-dependency-from-nexus-and-pass-a-revision

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...