Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9093

Deploy: Allow specification of Context Path

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      It would be great if we could specify the context-path that the .war gets deployed with.

      I'm trying to deploy a .war called "ROOT.war", but when it's deployed via Tomcat Manager it's context path is "/ROOT" instead of "/". After restarting Tomcat, the normal Tomcat behaviour of treating a .war called ROOT.war as the default context takes over, but then we have two contexts instead of one.

        Attachments

          Issue Links

            Activity

            Hide
            olamy Olivier Lamy added a comment -

            I was thinking about this too recently
            An other improvement (at least for tomcat) could be deploying a context file too.

            Show
            olamy Olivier Lamy added a comment - I was thinking about this too recently An other improvement (at least for tomcat) could be deploying a context file too.
            Hide
            kitora_naoki Naoki Kitora added a comment - - edited

            I caught a following error.

            ----------------------------------------------------------------------
            Deploying /var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war to container Tomcat 7.x Remote
            [/var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war] is not deployed. Doing a fresh deployment.
            Deploying [/var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war]
            ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
            org.codehaus.cargo.container.ContainerException: Failed to deploy [/var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war]
            at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111)
            at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)

            — snip —

            Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Failed to deploy application at context path /ROOT

            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:507)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
            at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
            ... 18 more

            Show
            kitora_naoki Naoki Kitora added a comment - - edited I caught a following error. ---------------------------------------------------------------------- Deploying /var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war to container Tomcat 7.x Remote [/var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war] is not deployed. Doing a fresh deployment. Deploying [/var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war] ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception org.codehaus.cargo.container.ContainerException: Failed to deploy [/var/data/hudson/.hudson/jobs/*****/workspace/tmp/ROOT.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187) — snip — Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Failed to deploy application at context path /ROOT at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:507) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107) ... 18 more
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Willem Verstraeten
            Path:
            src/main/java/hudson/plugins/deploy/CargoContainerAdapter.java
            src/main/java/hudson/plugins/deploy/ContainerAdapter.java
            src/main/java/hudson/plugins/deploy/DeployPublisher.java
            src/main/java/hudson/plugins/deploy/tomcat/TomcatAdapter.java
            src/main/resources/hudson/plugins/deploy/DeployPublisher/config.jelly
            src/main/resources/hudson/plugins/deploy/DeployPublisher/help-contextPath.html
            src/test/java/hudson/plugins/deploy/glassfish/GlassFish3xAdapterTest.java
            http://jenkins-ci.org/commit/deploy-plugin/9d8dd8591be6e23b3d8fc237761628141a038bdd
            Log:
            JENKINS-9093 : the context path can now also be specified

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Willem Verstraeten Path: src/main/java/hudson/plugins/deploy/CargoContainerAdapter.java src/main/java/hudson/plugins/deploy/ContainerAdapter.java src/main/java/hudson/plugins/deploy/DeployPublisher.java src/main/java/hudson/plugins/deploy/tomcat/TomcatAdapter.java src/main/resources/hudson/plugins/deploy/DeployPublisher/config.jelly src/main/resources/hudson/plugins/deploy/DeployPublisher/help-contextPath.html src/test/java/hudson/plugins/deploy/glassfish/GlassFish3xAdapterTest.java http://jenkins-ci.org/commit/deploy-plugin/9d8dd8591be6e23b3d8fc237761628141a038bdd Log: JENKINS-9093 : the context path can now also be specified
            Hide
            willemv Willem Verstraeten added a comment -

            I've just pushed the fix for this. I accidentally pushed right into the main repository instead of creating a pull-request though ... Can someone make a new release, or should I ? And should someone else take a look at my changes ?

            Show
            willemv Willem Verstraeten added a comment - I've just pushed the fix for this. I accidentally pushed right into the main repository instead of creating a pull-request though ... Can someone make a new release, or should I ? And should someone else take a look at my changes ?
            Hide
            tholewebgods Thomas Lehmann added a comment -

            I just built a snapshot of this plugin (at 37ae083) an tried the context path feature. It unfortunately does not work.

            Trying to deploy to a GlassFish 3.1.2 with ContextRoot "/A" deployed the application with ContextRoot "/" (examined with GlassFish admin website).

            Show
            tholewebgods Thomas Lehmann added a comment - I just built a snapshot of this plugin (at 37ae083) an tried the context path feature. It unfortunately does not work. Trying to deploy to a GlassFish 3.1.2 with ContextRoot "/A" deployed the application with ContextRoot "/" (examined with GlassFish admin website).
            Hide
            leif81 Leif Gruenwoldt added a comment -

            For those who reopened this bug, I recommend you check your web project for a META-INF/context.xml file. My project contained this file and had a context "path" param. I removed the context.xml file entirely (to use defaults) and now the Jenkins deploy plugin responds to the "Context path" specified in the job.

            Show
            leif81 Leif Gruenwoldt added a comment - For those who reopened this bug, I recommend you check your web project for a META-INF/context.xml file. My project contained this file and had a context "path" param. I removed the context.xml file entirely (to use defaults) and now the Jenkins deploy plugin responds to the "Context path" specified in the job.
            Hide
            leandro_freitas_softdevelop Leandro Kersting de Freitas added a comment -

            Solution for context already exists in the current version.

            Show
            leandro_freitas_softdevelop Leandro Kersting de Freitas added a comment - Solution for context already exists in the current version.

              People

              Assignee:
              leandro_freitas_softdevelop Leandro Kersting de Freitas
              Reporter:
              deejay Daniel Jones
              Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: