Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven + Tomcat acceleration

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

So, I run Maven like this: mvn clean compile. It is reasonable that after this operation I must re-run Tomcat so it can reinitialize the context (Sysdeo Tomcat launcher helps a lot).

The problem is Maven execution and subsequent Tomcat re-running takes noticable amount of time (like 10+ seconds for Maven and 20+ sec. for Tomcat, because of logging, O/R mappings, etc.) every time I do it.

Is there any automated and more faster solution for these operations? As I see it, a way better solution can be moving re-compiled classes only to the target dir.

like image 625
MiKo Avatar asked Jan 19 '26 01:01

MiKo


1 Answers

Is there any automated and more faster solution for these operations? As I see it, a way better solution can be moving re-compiled classes only to the target dir.

Well, the question is why do you run clean each time? Doing incremental compilation would already speed up things a lot.

Update: I agree with @Carl about Eclipse WTP that provides very good support of Tomcat (I don't really see the added value of the Sysdeo plugin nowadays). Using Eclipse WTP for development and running Maven before to commit the changes to check that you didn't break the continuous build is a very typical workflow. And both the maven-eclipse-plugin and m2eclipse (the two alternatives for Maven and Eclipse integration) support the WTP i.e. can get your project recognized as a dynamic project than can be Run on a Server.

like image 66
Pascal Thivent Avatar answered Jan 20 '26 15:01

Pascal Thivent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!