![]() ![]() Now you can call “deployfoo.bat” for deploying the foo web application. That’s why we need a wait and Ping can do that. when Tomcat is not running, it would terminate the whole script, hence nothing gets deployed. This would happen without it, becase shutdown.bat is called asynchonously, which is necessary, beause if the shutdown fails i.e. This is, because the Windows CMD shell does not have a sleep or wait command, but it is important that the shutdown has finished before trying to delete the files. Save this snippet for instance as “deployfoo.bat”. Rmdir E:\Apache\apache-tomcat-6.0.18\webapps\foo /S /Qĭel E:\Apache\apache-tomcat-6.0.18\webapps\foo.war /QĬall E:\Apache\apache-tomcat-6.0.18\bin\startup.bat As a workaround I wrote a script that wraps these steps:Ĭall E:\Apache\apache-tomcat-6.0.18\bin\shutdown.bat They can only be deleted after stopping the whole Tomcat server. It seems that the XML parser inside Tomcat reads some DTD files from the jar files and does not properly release them, so the jars remain being used, even after stopping the application. Tick build on make on the artifact configuration 3) do a mvn. The server has to be stopped and the files manually removed. 2) Create a Tomcat/Local Run-configuration, add the xxx exploded artifact to the deployments. ![]() The reason is that some of the JSF related jars get locked by Tomcat and the undeployment remains unfinished. But if you are using JSF libraries, it may happen that only the first deployment works and any subsequent deployment fails. Now the configuration is theoretically done and mvn tomcat:deployĬan be executed. You can run your War Apache Maven project through Apache Maven without deploying your WAR file to an Apache Tomcat instance. Use any other value if you feel 256M is too small or too big. The Apache Tomcat Maven Plugin provides goals to manipulate WAR projects within the Apache Tomcat servlet container. Add the following line at the beginning of your mvn.bat (after all the comments): MAVEN_OPTS=-Xmx256M But the actual deployment step, which uploads the jar to the Tomcat server needs a lot of heap memory, so I increase the heap size that is available to Maven. I’m using a relative path here, because I call mvn from the project root directory.įor the automatic deployment of a war file you can use the follwoing targets:Īctually, the redeploy target is sufficient, because it can also deploy when there is no existing web application. Apache Maven is a software project management and comprehension tool. The variable path ist the context root of the “foo” application and warFile is the location of your build target, wherever your build step creates the war file. The variables url, username and password must be set according to your Tomcat installation. tomcat-maven-plugin admin admin /foo target/foor.war ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |