简体   繁体   中英

Grails Release Plugin Maven Deployment doesn't update <latest> tag in maven-metadata.xml consistently

Background

I have two Grails applications, both running Grails 2.3.6 with the release plugin installed ( build ":release:3.0.1" ).

I have a jenkins CI server setup to automatically pull the projects from source control and deploy the war to artifactory. From there, it can be automatically deployed to our tomcat server by a script.

For one application, the maven-metadata.xml file generated by Artifactory contains a <latest> tag, which specifies which of the versions of my application is the latest one.

Problem

My problem is, the other application doesn't have a <latest> tag, even though it's using the exact same command to deploy to our Artifactory repository-- grails maven-deploy . The BuildConfig.groovy files are basically identical.

This is a problem because I need that <latest> information to be available for my deployment script.

From what I've read around the web , the maven-metadata.xml file is generated by maven 2 only when the -DupdateReleaseInfo=true flag is set. However, I can't see any place that the working application is passing this flag to maven during the build.

I've tried the fix suggested on this thread -- namely,

  • Making sure that deploying user has "annotate" permission
  • Maven Snapshot Version Behavior = "Deployer"

But my second application still doesn't get a <latest> tag added to its maven-metadata.xml.

So, I figured out that I can easily just pass -DupdateReleaseInfo=true to the grails maven-deploy command as an additional argument, and that forces maven to update the <latest> tag in maven-metadata.xml. I'm not sure why it is doing it sometimes and not others, but at least it works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM