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.