Apache Tomcat Maven Plugin
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-142

contextFile path="..." ignored when using tomcat7:run

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.0
    • Component/s: tomcat7
    • Labels:
      None

      Description

      contextFile path="..." ignored when using tomcat7:run. I have been trying to use a custom context file (with contextFile config param). I can see the context being logged in the console, but the path attribute is ignored, and for all I know so are other settings (the app is always deployed with path=$

      {project.artifactId}

      ).

        Activity

        Dave Syer created issue -
        Dave Syer made changes -
        Field Original Value New Value
        Summary contextFile path="..." ignored when using tomcat:run contextFile path="..." ignored when using tomcat7:run
        Description contextFile path="..." ignored when using tomcat:run. I have been trying to use a custom context file (with contextFile config param). I can see the context being logged in the console, but the path attribute is ignored, and for all I know so are other settings (the app is always deployed with path=${project.artifactId}). contextFile path="..." ignored when using tomcat7:run. I have been trying to use a custom context file (with contextFile config param). I can see the context being logged in the console, but the path attribute is ignored, and for all I know so are other settings (the app is always deployed with path=${project.artifactId}).
        Olivier Lamy (*$^¨%`£) made changes -
        Fix Version/s 2.0 [ 12319450 ]
        Hide
        Dave Syer added a comment - - edited

        Great to see this is scheduled for 2.0. Note also that the contextFile does not have a $

        {maven.tomcat.*}

        expression that can be used to specify it on the command line. that would be useful if you are going to hack around in there a bit.

        Show
        Dave Syer added a comment - - edited Great to see this is scheduled for 2.0. Note also that the contextFile does not have a $ {maven.tomcat.*} expression that can be used to specify it on the command line. that would be useful if you are going to hack around in there a bit.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        you mean applying filtering for the file with Maven sys props ?

        Show
        Olivier Lamy (*$^¨%`£) added a comment - you mean applying filtering for the file with Maven sys props ?
        Hide
        Dave Syer added a comment -

        I guess that's what I mean, but I wouldn't have used those words. For instance the path config can be provided on the command line with -Dtomcat.maven.path=/foo, but there is no corresponing setting for the contextFile (as can be seen here http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat7-maven-plugin/run-mojo.html or in the plugin.xml).

        Show
        Dave Syer added a comment - I guess that's what I mean, but I wouldn't have used those words. For instance the path config can be provided on the command line with -Dtomcat.maven.path=/foo, but there is no corresponing setting for the contextFile (as can be seen here http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat7-maven-plugin/run-mojo.html or in the plugin.xml).
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        oh ok I see. I was talking about something different .
        in your context file :
        <Context path="$

        {foo.mypath}

        "/>
        So you could use -Dfoo.mypath=

        Show
        Olivier Lamy (*$^¨%`£) added a comment - oh ok I see. I was talking about something different . in your context file : <Context path="$ {foo.mypath} "/> So you could use -Dfoo.mypath=
        Hide
        Dave Syer added a comment -

        If I could do that it would be useful too. But not as easy for you as just exposing an expression.

        Show
        Dave Syer added a comment - If I could do that it would be useful too. But not as easy for you as just exposing an expression.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        Not a problem I already did that here http://maven.apache.org/shared/maven-filtering/ in a shared maven library

        Show
        Olivier Lamy (*$^¨%`£) added a comment - Not a problem I already did that here http://maven.apache.org/shared/maven-filtering/ in a shared maven library
        Olivier Lamy (*$^¨%`£) committed 1325842 (1 file)
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        all done.
        Have fun

        Show
        Olivier Lamy (*$^¨%`£) added a comment - all done. Have fun
        Olivier Lamy (*$^¨%`£) made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin-mvn3.x #131 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/131/)
        MTOMCAT-142 contextFile path="..." ignored when using tomcat7:run (Revision 1325842)

        Result = FAILURE
        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1325842
        Files :

        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin-mvn3.x #131 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/131/ ) MTOMCAT-142 contextFile path="..." ignored when using tomcat7:run (Revision 1325842) Result = FAILURE olamy : http://svn.apache.org/viewvc/?view=rev&rev=1325842 Files : /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        Hide
        Dave Syer added a comment -

        Olivier, you marked this as fixed, but it doesn't seem to work for me. I grabbed a snapshot (20120413.171048-58) - maybe your change is not deployed yet? Specifiying -Dmaven.tomcat.contextFile on the command line I can see that the value is picked up when I look at the console output, but it still completely ignores my context.xml. Can you send me a context.xml that works to change the context root?

        Show
        Dave Syer added a comment - Olivier, you marked this as fixed, but it doesn't seem to work for me. I grabbed a snapshot (20120413.171048-58) - maybe your change is not deployed yet? Specifiying -Dmaven.tomcat.contextFile on the command line I can see that the value is picked up when I look at the console output, but it still completely ignores my context.xml. Can you send me a context.xml that works to change the context root?
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        weird.
        Are you using an absolute or relative path in -Dmaven.tomcat.contextFile ?
        I have something very simple based on http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml

        Show
        Olivier Lamy (*$^¨%`£) added a comment - weird. Are you using an absolute or relative path in -Dmaven.tomcat.contextFile ? I have something very simple based on http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/tomcat-context-archiva.xml
        Hide
        Dave Syer added a comment -

        That app has the same artifact I'd as the path in your context.xml, I think. What happens if you change the path in the context.xml? JIRA SUCKS ON AN IPHONE.

        Show
        Dave Syer added a comment - That app has the same artifact I'd as the path in your context.xml, I think. What happens if you change the path in the context.xml? JIRA SUCKS ON AN IPHONE.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        If I use <Context path="/foo"> the webapp is available on /foo

        Show
        Olivier Lamy (*$^¨%`£) added a comment - If I use <Context path="/foo"> the webapp is available on /foo
        Hide
        Dave Syer added a comment -

        OK, yes that works. But <Context path=""/> does not work (and I think that's correct), and <Context path="/"/> breaks in the same way as MTOMCAT-141.

        Show
        Dave Syer added a comment - OK, yes that works. But <Context path=""/> does not work (and I think that's correct), and <Context path="/"/> breaks in the same way as MTOMCAT-141 .
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        oops my bad. Should be better now with r1326764. (SNAPSHOT deployed)

        Show
        Olivier Lamy (*$^¨%`£) added a comment - oops my bad. Should be better now with r1326764. (SNAPSHOT deployed)
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin-mvn3.x #136 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/136/)
        MTOMCAT-142 fix context file using / path (Revision 1326764)

        Result = FAILURE
        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1326764
        Files :

        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin-mvn3.x #136 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/136/ ) MTOMCAT-142 fix context file using / path (Revision 1326764) Result = FAILURE olamy : http://svn.apache.org/viewvc/?view=rev&rev=1326764 Files : /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        Hide
        Dave Syer added a comment -

        Yes, that works now. But only with path="/". Is that right? Or should it be path=""?

        Show
        Dave Syer added a comment - Yes, that works now. But only with path="/". Is that right? Or should it be path=""?
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        sure only "/" works. if path="" that's considered as no path defined.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - sure only "/" works. if path="" that's considered as no path defined.

          People

          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Reporter:
            Dave Syer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development