user3114967
user3114967

Reputation: 629

Is it possible to deploy multiple war file in tomcat using Jenkins?

I'm Using Jenkins and Tomcat7. if i deploy a single war file in tomcat using Jenkins it's working fine. I tried to deploy multiple different war file in tomcat one by one. first war file was deployed successfully, after that i can't deploy another war file in same tomcat folder. But i want deploy multiple .war file of different application in single tomcat folder using Jenkins.

Is it possible to deploy multiple war file in tomcat using Jenkins? If it is yes means how can i achieve? OR any other way to solve this issue?

ERROR:

Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Deployed application at context path /warttwo but context failed to start

Upvotes: 3

Views: 2390

Answers (1)

Bendy Zhang
Bendy Zhang

Reputation: 501

In my case:

  1. Copy all war files to one folder (Execute shell under Post Steps)

    mkdir -p wars
    rm -f wars/*
    mv app1/target/app1.war wars/
    mv app2/target/app2.war wars/

  2. Under Deploy war/ear to a container under Post-build Actions section

    WAR/EAR files: wars/*.war
    Context path: [leave empty]
    Containers -> Tomcat URL: http://localhost:8080

Then, you can visit http://localhost:8080/app1 or http://localhost:8080/app2

NOTE: The Credentials of Deploy war/ear to a container must have manager-script role so that can deploy your war files to your webapps folder in tomcat

Upvotes: 3

Related Questions