1
votes

I am currently trying to set a path that is different from my artifactId of the maven-project. Unfortunately, my attempts do not work.

I tried setting it by

   <build>
      <plugins>
        [...]
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <path>/AWV</path>
            </configuration>
        </plugin>
      </plugins>
      <finalName>AWV</finalName>
    </build>

but when calling mvn tomcat7:run-war none of them works (but the war is corretly named AWV.war).

All documentation I could find (http://mojo.codehaus.org/tomcat-maven-plugin/configuration.html, http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/run-war-mojo.html) says I could do this by setting the path this way.

Alternatively, I tried running tomcat with mvn tomcat7:run-war -Dmaven.tomcat.path=/AWV which didn't work either. Additional hints, like executing clean before (Eclipse maven run configuration using 'run' goal from tomcat7 maven plugin doesn't respect default context path) did not work either.

Has anyone an idea how to solve this?

Edit: This also happens when using 2.3-SNAPSHOT of the tomcat-maven-plugin.

1
What version to tomcat are you using?Skizzo
I am using Tomcat7 and the corresponding plugin-version.David Georg Reichelt

1 Answers

2
votes

After searching for some time, I found out the mistake: in src/main/webapps/META-INF/context.xml there was the text:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/awv-seite"/>

I have no clue how this file got there, probably eclipse or NetBeans created it. This prevented all my other tries from beeing successfull, after setting the path there, everything works.