Jenkins fresh deployment works using the container deployment plugin, but fails if redistribution

I want to configure my maven based web application to build and deploy as part of my normal work.

The line works fine, however using the container deployment plugin seems unreliable in the fact that the new deployment works, but the application redistribution fails. The plugin cannot be deployed when the application is already deployed (the war is already in the webapps directory). To be clear, if I remove the war and cancel everything, and then to create the Jenkins, it will work as expected, but then they will fail. Error message:

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

Should I instead deploy as part of the maven assembly itself, using deploy: deploy and adding a distribution control section?

Or is it their jenkins installation that I don't see?

+4
source share
5 answers

I do it fooobar.com/questions/1358927 / ...

I can either call the load: redeploy as a post-build step if I want to have deployment details stored in pom

Or I call the load: undeploy as a post-build step, and then use the plugin to deploy the container to actually deploy using the settings I inserted into jenkins.

0
source

Had only the same problem. Surprisingly, in my case, everything else helped.

Looked at tomcat logs during OutOfMemory: Permgen space and saw OutOfMemory: Permgen space . Increasing XX:PermSize and XX:MaxPermSize to 256 m in $CATALINA_HOME/bin/setenv.sh completely resolved this problem.

+4
source

Firstly, the maven deploy plugin does not deploy the web application in the container. It deploys the project artifact into the maven repository. Therefore, it cannot be used for your purpose.

Secondly, refer to this related to open jira problem. It also offers a solution / solution to the problem.

+1
source

Before deploying a war file, you can deploy an existing package using this. http://mojo.codehaus.org/tomcat-maven-plugin/undeploy-mojo.html I think you can add this task to the same job before deployment. That way you can still have CI as you expect.

+1
source

It is also possible if you try to deploy 2 applications with the same context root in the context.xml file (but another one is defined in jenkins during deployment).

If necessary, manually clean / webapps and restart the server. Now it works again.

+1
source

Source: https://habr.com/ru/post/1393739/


All Articles