简体   繁体   English

Jenkins全新部署使用容器部署插件,但如果重新部署则失败

[英]Jenkins fresh deploy works using container deployment plugin, but fails if redeploying

I want to set up my maven built web app, to build and deploy as part of my regular job. 我想设置我的maven构建的Web应用程序,以构建和部署作为我的常规工作的一部分。

The build works fine, however using the container deployment plugin seems unreliable in that a fresh deployment works but redeploying the app fails. 构建工作正常,但使用容器部署插件似乎不可靠,因为新的部署工作但重新部署应用程序失败。 The plugin can not deploy when app is already deployed (the war is already in webapps directory). 当已经部署应用程序时,该插件无法部署(战争已经在webapps目录中)。 To be clear if I delete the war's and undeploy everthing and then to a jenkins build it works as expected but then subsequently they fail. 要清楚的是,如果我删除war和取消部署everthing然后到jenkins构建它按预期工作但随后它们失败。 The error message is : 错误消息是:

org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Encountered exception javax.management.RuntimeErrorException: Error invoking method check

Should I instead be deploying as part of the maven build itself, using deploy:deploy and adding a distribution management section ? 我应该使用deploy:deploy和添加分发管理部分来部署作为maven构建本身的一部分吗?

Or is their a jenkins setting i am missing ? 或者他们是一个我失踪的jenkins设置?

Had just the same issue. 有同样的问题。 Surprisingly, completely other things helped in my case. 令人惊讶的是,在我的案例中完全有其他事情有帮

Looked at tomcat logs at redeploy time, and saw OutOfMemory: Permgen space . 在重新部署时查看了tomcat日志,并看到了OutOfMemory: Permgen space Increasing XX:PermSize and XX:MaxPermSize to 256m in $CATALINA_HOME/bin/setenv.sh solved this issue completely. $CATALINA_HOME/bin/setenv.sh XX:PermSizeXX:MaxPermSize增加到256m完全解决了这个问题。

Might also happen if you try to deploy 2 apps with the same context root in context.xml (but another defined in jenkins when deploying). 如果您尝试在context.xml中部署具有相同上下文根的2个应用程序(但在部署时在jenkins中定义了另一个应用程序),也可能会发生。

Had to manually clean /webapps and restart the server. 不得不手动清理/ webapps并重启服务器。 Works again now. 现在再次工作。

Firstly, maven deploy plugin does not deploy a web application to a container. 首先,maven deploy plugin不会将Web应用程序部署到容器。 It deploys the project artifact to a maven repository. 它将项目工件部署到maven存储库。 So, it cannot be used for your purpose. 因此,它不能用于您的目的。

Secondly, refer to this related open jira issue. 其次,请参阅相关的open jira问题。 This also suggests a solution/workaround. 这也表明了解决方案/解决方法。

before you deploy the war file you can undeploy the existing package by using this. 在部署war文件之前,您可以使用此方法取消部署现有包。 http://mojo.codehaus.org/tomcat-maven-plugin/undeploy-mojo.html I think you can add this task in the same job before you do the deployment.So you can still have CI as you are expecting. http://mojo.codehaus.org/tomcat-maven-plugin/undeploy-mojo.html我认为您可以在部署之前在同一作业中添加此任务。因此您仍然可以按照预期使用CI。

I am doing this https://stackoverflow.com/a/6524012/106261 我这样做https://stackoverflow.com/a/6524012/106261

I can either call cargo:redeploy as a post build step if I want to have deployment detail stored within pom 我可以调用货物:如果我想将部署细节存储在pom中,则重新部署为后期构建步骤

Or I call cargo:undeploy as a post build step, then use container deploy plugin to actually deploy using the settings I put in jenkins. 或者我称之为货物:取消部署作为后期构建步骤,然后使用容器部署插件使用我在jenkins中设置的实际部署。

暂无
暂无

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

相关问题 Maven 构建无法在 jenkins websphere 部署插件中部署 - Maven build fails to deploy in jenkins websphere deployment plugin Jenkins 在没有 websphere 部署插件的情况下部署到 webshpere - Jenkins deploy to webshpere without websphere deployment plugin 如何在将war / ear部署到容器的同时将WAR部署构建回退到Jenkins中较早的成功的tomcat部署 - How to rollback a WAR deployment build to a earlier successful tomcat deployment in Jenkins, while using Deploy war/ear to a container 在Tomcat上使用Jenkins重新部署Grails应用程序会填充PermGen空间 - Redeploying a Grails App using Jenkins on Tomcat fills PermGen Space 如何在没有反向代理容器的情况下使用 docker-compose 部署启用 HTTPS 的 Jenkins 容器? - How do I deploy HTTPS enabled Jenkins container using docker-compose WITHOUT a reverse proxy container? 如何使用hudson或jenkins Websphere部署插件在Websphere Cluster环境中部署EAR应用程序 - How to deploy the EAR application in Websphere Cluster environment using hudson or jenkins Websphere deploy plugin 使用Jenkins Deploy插件部署到Tomcat而不删除上下文xml文件 - Deploy to Tomcat using Jenkins Deploy plugin without deleting context xml file Artifactory Maven插件无法部署 - Artifactory maven plugin fails to deploy 无法获取org.jacoco.maven.AgentMojo的Class-Jenkins无法使用JaCoCo maven插件进行构建,但可以在本地使用 - Failed to getClass for org.jacoco.maven.AgentMojo - Jenkins fails to build with JaCoCo maven plugin but works locally 詹金斯:将War文件部署到Wildfly失败 - Jenkins: Deployment of war file to Wildfly fails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM