version maven plugin versions:use-releases only find release in .m2 but could not find in remote repository

15 views
Skip to first unread message

Ming Wu

unread,
Dec 3, 2019, 2:00:45 PM12/3/19
to mojohaus-dev
Hi, 

I am trying to use versions:use-release feature in version maven plugin to manipulate my pom file. But it turns out that it can find release version if it is available in .m2. If the release version is available in remote repository but not in .m2, it can not find the release version of an module. Is this expected behavior?

Here is my story in details: 
I need to replace my module's parent and dependent modules' snapshot version with release version for the process of release. 

First, I run "mvn versions:set -DremoveSnapshot=true versions:commit" to remove my module's snapshot version. It works well.

Next, I run "mvn versions:use-releases -DprocessParent=true versions:commit". It does not do anything. From the output of mvn,
``` 
[INFO] artifact com.xxxxx:parent: checking for updates from maven-group
[INFO] artifact com.xxxxx:parent: checking for updates from central
```

It seems that it checks my repo, "maven-group", but it could not find it. I do have parent release verion in "maven-group", 0.0.3. the snapshot version in my pom is 0.0.3-SNAPSHOT. 

However, if I build the release version of my parent in my local machine (the 0.0.3 of parent will be in .m2), this command can update parent module from 0.0.3-SNAPSHOT to 0.0.3. Same thing for dependent module. So it looks to me that versions:use-release only only find the release version info in .m2.

Here is my repo in pom. I use nexus repo. maven-group is the entry for release and snapshot repo.

```
<repository>
    <id>maven-group</id>
</repository>
```

Do anyone have some ideas? I have tried to add 
```  
<id>maven-group</id>
<snapshots>
   <enabled>true</enabled>
</snapshots>
<releases>
   <enabled>true</enabled>"
</releases>" 
```
for maven-group or directly use maven-releases or maven-snapshots repo in pom file. But none of them works.

Any ideas or suggestions? I also tried to use mvn -X, it does not give more detailed information. If it finds the release version, it just print "update ....". Otherwise, no debug information available on what it could not find release version on remote repository. 

Thank you!

Reply all
Reply to author
Forward
0 new messages