Inside Eclipse, how to run the Tomcat Maven plugin, which changes the context path

Inside Eclipse, the m2 Maven plugin is installed. I can launch my webapp in Tomcat via Eclipse WTP using the "Run on Server" command.

Now I want to change the context path through Maven, so I use the following plugin:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <version>1.1</version>
        <configuration>
          <path>${contextpath-name}</path>
        </configuration>
</plugin>

But how exactly do you run this plugin inside Eclipse. Using Eclipse WTP always gives me the following URL -http://localhost:8080/myapp

I know that I can run the plugin on standalone Maven, but I want to know how to do it in Eclipse

+3
source share
1 answer

Assumption

I assume that you have already installed plugins for Maven for eclipse.

Installation

When you select a project in the project explorer, select Run → Run As → Maven Install

Tomcat

Run → Run Configurations..

Maven Build

, , war

tomcat: ( Tomcat)

, Eclipse.

.:)

+9

All Articles