Inside Eclipse with m2 Maven plugin installed. I can run my webapp in Tomcat via Eclipse WTP using "Run on Server" command.
Now I want to modify the context-path via 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 then how do you exactly run this plugin inside Eclipse. Using Eclipse WTP always gives me the following URL - http://localhost:8080/myapp
I know I could run the plugin on a standalone Maven, but I want to know how to do it within Eclipse
Assumption
I am assuming that you have already installed the plugins for Maven for eclipse.
Installation
While selecting the project in project explorer select Run --> Run As --> Maven Install
Running Tomcat
Go to Run --> Run Configurations..
Add new Maven Build
Name the Process, Select the Base directory that will be deployed as war
set the Goal --> tomcat:run (this is a default goal for Tomcat)
By following the steps you can deploy every thing via Eclipse.
Have fun. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With