简体   繁体   English

Grails版本插件Maven部署不会更新 <latest> 一致地在maven-metadata.xml中标记

[英]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" ). 我有两个Grails应用程序,两个应用程序都运行Grails 2.3.6,并安装了发布插件( 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. 我有一个jenkins CI服务器设置,可以自动从源代码管理中提取项目,并将战争部署到工件上。 From there, it can be automatically deployed to our tomcat server by a script. 从那里,它可以通过脚本自动部署到我们的tomcat服务器。

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. 对于一个应用程序,Artifactory生成的maven-metadata.xml文件包含一个<latest>标记,该标记指定我的应用程序的哪个版本是最新的。

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 . 我的问题是,另一个应用程序没有一个<latest>标记,即使它使用的是完全相同的命令部署到我们的Artifactory存储库中grails maven-deploy The BuildConfig.groovy files are basically identical. BuildConfig.groovy文件基本上是相同的。

This is a problem because I need that <latest> information to be available for my deployment script. 这是一个问题,因为我需要该<latest>信息可用于我的部署脚本。

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. 根据我在网上阅读的内容 ,仅当设置了-DupdateReleaseInfo=true标志时,maven 2才会生成maven-metadata.xml文件。 However, I can't see any place that the working application is passing this flag to maven during the build. 但是,在构建过程中,我看不到任何正在运行的应用程序将此标志传递给Maven的任何地方。

I've tried the fix suggested on this thread -- namely, 我已经尝试过在该线程上建议的修复程序-即,

  • Making sure that deploying user has "annotate" permission 确保部署用户具有“注释”权限
  • Maven Snapshot Version Behavior = "Deployer" Maven快照版本行为=“部署者”

But my second application still doesn't get a <latest> tag added to its maven-metadata.xml. 但是我的第二个应用程序仍然没有在其maven-metadata.xml中添加<latest>标记。

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. 因此,我发现我可以轻松地将-DupdateReleaseInfo=true传递给grails maven-deploy命令作为附加参数,这迫使maven更新maven-metadata.xml中的<latest>标记。 I'm not sure why it is doing it sometimes and not others, but at least it works! 我不确定为什么有时候而不是其他人这样做,但至少可以奏效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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