Tomcat Maven Plugin and Apache Tomcat post 6.0.29

Last Updated on Vendredi, 11 mars 2011 02:25 Written by Henri Gomez Vendredi, 11 mars 2011 12:56

If you’re using the Tomcat Maven Plugin and want to use post 6.0.29  Apache Tomcat, ie latest 6.0.32, you should update your pom to handle a change in artifact.

Up to 6.0.29, Eclipse JDT compiler was bundled as jasper-jdt :

<dependency>
              <groupId>org.apache.tomcat</groupId>
              <artifactId>jasper-jdt</artifactId>
              <version>6.0.29</version>
            </dependency>

With 6.0.30, Apache Tomcat team started to bundle Eclipse JDT directly:

<dependency>
  <groupId>org.eclipse.jdt.core.compiler</groupId>
  <artifactId>ecj</artifactId>
  <version>3.5.1</version>
</dependency>

As consequence, org.apache.tomcat/jasper-jdt artifact didn’t exist anymore after release 6.0.29.

Jasper JDT up to 6.0.29

Jasper JDT up to 6.0.29

For Tomcat Maven Plugin, you should update the suggested pom like this :

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tomcat-maven-plugin</artifactId>
                    <version>1.2-SNAPSHOT</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>catalina</artifactId>
                            <version>${tomcat.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>catalina-ha</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tribes</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>el-api</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>jasper</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>jasper-el</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.eclipse.jdt.core.compiler</groupId>
                            <artifactId>ecj</artifactId>
                            <version>3.5.1</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>jsp-api</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>servlet-api</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>coyote</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>dbcp</artifactId>
                            <version>${tomcat.version}</version>
                            <scope>runtime</scope>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>

Notice: An updated version of Tomcat Maven Plugin 1.2-SNAPSHOT has been released, this hack is no more necessary

Learn More
Designed by RocketTheme
WordPress is Free Software released under the GNU/GPL License.