石荒人
石荒人

Reputation: 963

How to change tomcat version in maven plugin( org.apache.tomcat.maven )

I have a problem to fix. Our company using tomcat 6.0 to run. Now we need to using WebSocket in spring MVC,so my tomcat need to 7.0 at least but when I open the pom setting I can't change the tomcat.

We using org.apache.tomcat.maven to deploy tomcat.

I can not use a new pom to set tomcat because our maven is aggregation project. So I need some class form other projects.

If I can only change the tomcat version I will be loved.

This is my pom setting.

<build>
    <finalName>lgame-web-control</finalName>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>tomcat-maven-plugin</artifactId>
            <version>1.1</version>
            <configuration>
                <path>/</path>
                <port>8085</port>
                <uriEncoding>UTF-8</uriEncoding>
            </configuration>
        </plugin>

    </plugins>
</build>

please help me , I google but dont get the answer.

Upvotes: 2

Views: 1681

Answers (1)

Gayan Mettananda
Gayan Mettananda

Reputation: 1518

Use the new version of the plugin tomcat7-maven-plugin which uses the tomcat 7.0.47 version.

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.1</version>

    <dependencies>
        <dependency>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-util</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</plugin>

Upvotes: 2

Related Questions