Maven jetty Eclipse run stop debug Debug Java Web Project
The most obvious advantage of Maven in front of us is the management of the Peoject jar package. Of course maven's advantages are much more than that.
Under Eclipse, you can use M2eclipse to speed up the development of MAVEN project.
When you debug your Web project for maven these days, you find that you cannot shut down a Web project that is already running, only in the Task Manager
End the process. This is depressed, online looking for, also by the way summed up a bit.
Start "", "" "" "" "" "," "
Step 1. How to start a Web project for debugging:
1.1 I am using the jetty container. First, you configure the plugin in Pom.xml
<!--jetty Plugin-->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
1.2 Below configure an external tool to run jetty.
Select Menu Run->external tools->external Tools Configurations
--------------------》
Figure 1
Select Program on the left, then right-click NEW:
Configure location as the MVN command-line path.
Select working directory for the project you want to run currently.
Arguments fill in: Jetty:run as shown in Figure 2
Figure 2
After this operation, click Run, or point to Figure 3
Figure 3
You can run the project.
But at this point, it's just running the project and it's not up to the debug requirements.
2. Debug debugging the Web project,
2.1 In the click of the Environment option in Figure 2, add one, Environment varibles.
Add maven_opts variable, value is
-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
2.2 Under the Debug run configuration, click Debug->debug Configuration
Select the appropriate project in the configuration, and the port will be set to the same as the address=4000 in the maven_opts variable.
After the configuration is complete, you can set breakpoints for debug debugging.
First start the Web project in step 1, and then run the newly created remote Java application.
The following figure:
3. Finally, Jetty's shutdown.
3.1 First in the Pom.xml.
<!--jetty Plugin-->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
Modified to------------------->>>>>>>
<!--jetty Plugin-->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
</configuration>
</plugin>
First as shown in Figure 1, new
Then run the new program to shutdowm the jetty project that will run.
End "The" "" "The" "" "The" "" "The"