Speeding up Maven + Tomcat

I am writing a web application with Maven in the Eclipse IDE and using the Tomcat servlet container.

So I run Maven follows: mvn clean compile. It is reasonable that after this operation I have to restart Tomcat so that it can reinitialize the context (Sysdeo Tomcat multi-user program).

The problem is running Maven, and then re-executing Tomcat requires a noticeable amount of time (e.g. 10 seconds for Maven and 20+ seconds for Tomcat due to registration, O / R mappings, etc.) every time I do this he.

Is there an automatic and faster solution for these operations? As I see it, the best solution would be to move the recompiled classes only to the destination directory.

+3
source share
5 answers

Is there an automatic and faster solution for these operations? As I see it, the best solution would be to move the recompiled classes only to the destination directory.

So the question is why do you run cleanevery time? Performing incremental compilation would already speed up a lot.

: @Carl Eclipse WTP, Tomcat ( Sysdeo). Eclipse WTP Maven , , . maven-eclipse-plugin m2eclipse ( Maven Eclipse) WTP, .. , .

+4

Maven : . , Maven - , , ant.

ant , , . WEB-INF/classes web.xml, , Tomcat. / .

. Maven .


EDIT: , , : Eclipse, WTP, Java EE. , Ctrl-S, , Eclipse Tomcat, -. Eclipse , , , , /. , Maven, .

+3

JRebel. tomcat, . , , , .

+3

, Maven tomcat, "mvn tomcat: redeploy", maven , tomcat, . tomcat .

0

, , Eclipse "Build Automatically" (Project → Build Automatically ).
, , Eclipse .class .

0

Source: https://habr.com/ru/post/1743033/


All Articles