versions-maven-plugin: how to configure for remote artifact repositories

203 views
Skip to first unread message

Chih-Chieh Huang

unread,
Apr 14, 2017, 9:50:21 AM4/14/17
to mojohaus-dev
I am trying to use both "update-parent" and "use-releases" goals to update the version number in the parent section in the pom.xml file as well as the versions in the dependency section so that it can resolve versions from remote artifact repository such as Artifactory.

When executing either goal from the local computer, it can find newer version from the local .m2 directory without problem.

When using "maven artifactory plugin" (2.9.1)  together with versions-maven-plugin (2.3) on Jenkins server, "version-maven-plugin" was not able to consult remote repositories. It could be because "versions-maven-plugin" is not aware of the remote repositories configured for "artifactory maven plugin" but I am not entirely sure.

The following is the Jenkins pipeline script to use artifactory plugin and set up with resolver:

    rtMaven = Artifactory.newMavenBuild()
    rtMaven.resolver server: server, releaseRepo: 'xxx-release-virtual', snapshotRepo: 'xxx-snapshot-virtual'
    rtMaven.run pom: 'pom.xml', goals: 'versions:update-parent -DparentVersion=[0.0.2]'

I can verify that version exists on artifactory's virtual repository.

The current only way "versions-maven-plugin" is able to find the version is to have that version installed on the Jenkins server's .m2 directory.

Where can I find more information about how to configure remote repositories for "versions-maven-plugin" ?

Thank you.


Karl Heinz Marbaise

unread,
May 27, 2017, 3:14:01 PM5/27/17
to mojohaus-dev
Hi,

it sounds like your assumption is true, cause this means the information about the repositories are not known to Maven and not for the plugin...

The remote repositories for versions-maven-plugin are those configured as for Maven itself (settings.xml)...

Kind regards
Karl Heinz Marbaise
Reply all
Reply to author
Forward
0 new messages