maven 插件总结Eclipse调试原理可以参考http://www.ibm.com/developerworks/cn/opensource/os-eclipse-jav
maven 插件总结
Eclipse调试原理可以参考
http://www.ibm.com/developerworks/cn/opensource/os-eclipse-javadebug/
1 常用配置
Move to the "Environment" tab and click the "New" button to add a new variable named MAVEN_OPTS with the value:
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y
If you supply suspend=n instead of suspend=y you can start immediately without running the debugger and launch the debugger at anytime you really wish to debug.
Step 2
Then, pull up the "Run/Debug/Debug ..." menu item and select "Remote Java Application" and click the "New" button. Fill in the dialog by selecting your webapp project for the "Project:" field, and ensure you are using the same port number as you specified in the address= property above.
Now all you need to do is to Run/External Tools and select the name of the maven tool setup you created in step 1 to start the plugin and then Run/Debug and select the name of the debug setup you setup in step2.
From instructions provided by Rolf Strijdhorst on the Maven mailing list
Stopping Jetty
In order to stop the jetty server the "Allow termination of remote VM" should be checked in debug dialog in Step 2. When you have the jetty server running and the debugger connected you can switch to the debug perspective. In the debug view, right click on the Java HotSpot(TM) Client VM[localhost:4000] and chose terminate. This will stop the debugger and the jetty server.
第一步:RUN --》倒数第二个TOOLS里添加--》PROGRAM里--》new -->main里写
LOCATION:E:\apache-maven-3.0\bin\mvn.bat
WROKDING DIRECTORY选项目目录${workspace_loc:/jsp}
Arguments:jetty:run
ENVIRONMENT里NEW
NAME:MAVEN_OPTS
VALUE:-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
第二步:RUN-->DEBUG CONFIGRATION--》REMOTE JAVA APPLICATION里
PROJECT选要调试的项目,CONNECTION TYPE:选第一个
HOST:localhost
port:8000
先运行第一步再运行第二步
5 把JAR包COPY到LIB包下发布到TOMCAT上
mvn dependency:copy-dependencies
JAR包会都被COPY到target目录下WEB-INF下的LIB下
然后把整个LIB COPY到SRC/MAIN/WEBAPP/WEB-INF/LIB下
没有LIB目录就自己创建一个