Is it possible to set up Eclipse WTP for deploying WARs instead of copying over the target directory?
my core application running on Tomcat is deploying webapps itself. It gets the war from deploy location, does some processing and expands it into webapps directory and tomcat does the rest...
I need eclipse WTP only for JVM's hotswap / jdwp ... So I decided to try that out. But I can't figure out how to do th开发者_如何学Pythonat. WTP just copy over the target directory into webapps.
EDIT: It's a maven project, with m2eclipse wtp support
I am not sure that i totally understand your question but if you want tomcat not to expand the war juat set unpackWAR=false
in the context.xml
I need eclipse WTP only for JVM's hotswap / jdwp
jdwp or Hot Code Replacement is working no matter what. It works in WTP and also in the remote debugging setting - "catalina.sh jpda run" and connecting to it.
Is it possible to set up Eclipse WTP for deploying WARs instead of copying over the target directory ?
I don't think it is possible out of the box.
Also you can do something like this:
In Eclipse, open the "Run Configurations" manager (Run -> Run Configurations...)
On the "Java Application" node, right click and choose "New".
On the first tab (Main) select the project you are running in tomcat
In the Main Class field enter org.apache.catalina.startup.Bootstrap
On the Arguments tab, in the Program Arguments field enter start
In the VM arguments field enter the following:
-Xms1024m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=256m
-XX:+CMSClassUnloadingEnabled
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=true
-Dcatalina.base=/bundles/tomcat-6.0.x
-Dcatalina.home=/bundles/tomcat-6.0.x
-Djava.io.tmpdir=/bundles/tomcat-6.0.x/temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/bundles/tomcat-6.0.x/conf/logging.properties
You may also notice that I included tomcat's juli log manager so that all the normal web app configurations work as expected and in the Eclipse console, which is also very nice.
In the Working directory field choose "Other" and enter /bundles/tomcat-6.0.x/bin.
On the Classpath tab, remove any entries under User Entries and then choose "Add External JARs...". Select the 3 jars located in /bundles/tomcat-6.0.x/bin.
On the Source tab make sure that you have both Default, as well as your project in the list.
Optionally here you can add any plugin projects that you are working on, as well as adding the path to the jsp java classes (typically /bundles/tomcat-6.0.x/work/Catalina/localhost/_)
On the Common tag choose at least Debug and Run under "Display in favorites menu".
精彩评论