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

contextFile and tomcatUsers defined in pom.xml are not used with target tomcat7:run

    Details

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

      Description

      In the configuration of the plugin into my pom.xml, I've defined the path to the contextFile and the tomcatUsers like this :

      <contextFile>$

      {appdir}/context.xml</contextFile>
      <tomcatUsers>${appdir}

      /tomcat-users.xml</tomcatUsers>

      It works using version 2.0-beta-1 and worked with 2.0-SNAPSHOT until a few days ago. Tomcat7 start correctly, but my tomcat-users.xml is not used and I cannot authentied services deployed on my tomcat. I use this configuration with jenkins for testing.

      Is there a regression in 2.0-SNAPSHOT or a new configuration issue ?

        Activity

        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin-mvn3.x #140 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/140/)
        MTOMCAT-143 contextFile and tomcatUsers defined in pom.xml are not used with target tomcat7:run
        configuring realm must be done before adding context. (Revision 1329339)

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

        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
        • /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 #140 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/140/ ) MTOMCAT-143 contextFile and tomcatUsers defined in pom.xml are not used with target tomcat7:run configuring realm must be done before adding context. (Revision 1329339) Result = SUCCESS olamy : http://svn.apache.org/viewvc/?view=rev&rev=1329339 Files : /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        Olivier Lamy (*$^¨%`£) made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        Should be fixed now.
        Please test with last deployed SNAPSHOT

        Show
        Olivier Lamy (*$^¨%`£) added a comment - Should be fixed now. Please test with last deployed SNAPSHOT
        Olivier Lamy (*$^¨%`£) committed 1329339 (2 files)
        Olivier Lamy (*$^¨%`£) made changes -
        Field Original Value New Value
        Fix Version/s 2.0 [ 12319450 ]
        Hide
        Raphaël Zürcher added a comment -

        Here is my configuration in pom.xml :

        <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0-SNAPSHOT</version>
        <configuration>
        <domain>TomcatRunner</domain>
        <port>$

        {app.port}

        </port>
        <url>/manager</url>
        <path>$

        {app.contexturl}

        </path>
        <contextFile>$

        {appdir}/context.xml</contextFile>
        <tomcatUsers>${appdir}

        /tomcat-users.xml</tomcatUsers>
        <useTestClasspath>true</useTestClasspath>
        <contextReloadable>true</contextReloadable>
        <fork>$

        {tomcat.fork}

        </fork><!-- fork=true will stop tomcat after run -->
        </configuration>
        <executions>
        <execution>
        <id>tomcat-run</id>
        <phase>pre-integration-test</phase>
        <goals>
        <goal>run-war-only</goal>
        </goals>
        </execution>
        <execution>
        <id>tomcat-shutdown</id>
        <phase>post-integration-test</phase>
        <goals>
        <goal>shutdown</goal>
        </goals>
        </execution>
        </executions>
        <dependencies>
        <dependency><!-- Servler 2.x not compatible with Tomcat 7 -->
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        </dependency>
        <dependency>
        <groupId>oracle.jdbc</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>$

        {oracle.version}

        </version>
        </dependency>
        </dependencies>
        </plugin>

        Since the middle of the last week, this doesn't work anymore. The definition of my users in the specified tomcat-users.xml is not used.

        Show
        Raphaël Zürcher added a comment - Here is my configuration in pom.xml : <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0-SNAPSHOT</version> <configuration> <domain>TomcatRunner</domain> <port>$ {app.port} </port> <url>/manager</url> <path>$ {app.contexturl} </path> <contextFile>$ {appdir}/context.xml</contextFile> <tomcatUsers>${appdir} /tomcat-users.xml</tomcatUsers> <useTestClasspath>true</useTestClasspath> <contextReloadable>true</contextReloadable> <fork>$ {tomcat.fork} </fork><!-- fork=true will stop tomcat after run --> </configuration> <executions> <execution> <id>tomcat-run</id> <phase>pre-integration-test</phase> <goals> <goal>run-war-only</goal> </goals> </execution> <execution> <id>tomcat-shutdown</id> <phase>post-integration-test</phase> <goals> <goal>shutdown</goal> </goals> </execution> </executions> <dependencies> <dependency><!-- Servler 2.x not compatible with Tomcat 7 --> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>oracle.jdbc</groupId> <artifactId>ojdbc6</artifactId> <version>$ {oracle.version} </version> </dependency> </dependencies> </plugin> Since the middle of the last week, this doesn't work anymore. The definition of my users in the specified tomcat-users.xml is not used.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        contextFile not used with current trunk ? Sure ??
        Any sample project to show this issue ?

        Show
        Olivier Lamy (*$^¨%`£) added a comment - contextFile not used with current trunk ? Sure ?? Any sample project to show this issue ?
        Raphaël Zürcher created issue -

          People

          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Reporter:
            Raphaël Zürcher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development