Eclipse auto build for maven build?

I have my main web app (has its own POM) which depends on module A ((has its own POM). When I do build using mvn install in a web app it depends on the modules are also embedded in the jar file and eventually included in the WEB-INF / lib folder of the main web application.

But this doesn't happen when I do the build using eclipse kepler (containing both maven projects and the main web application and its dependent module A). When building with eclipse, it just puts the changed classes in moduleA / target / classes / folder, but doesn't make the updated jar file and puts it in the WEB-INF / lib folder of the main web application.

Is there an option where I can configure eclipse by building the project the same way as maven (which will really save a lot of time and help with hot deployments)? It worked in one of my projects, it looks like it requires some kind of configuration.

looks like a m2e connector (I have a SonarQube) some configuration is required to make the eclipse build the same as maven build

When I do project > right click > mvn install

, I can create a jar file.

But what I want is an auto select eclipse build for the project / module, wherever the modification is done, build the jar and include it in the parent WEB-INF / lib folder if it is a dependent module?

+3


source to share


1 answer


Assuming you are using the Java EE flavor of Eclipse, you can easily deploy Maven based web applications to your local server (e.g. Tomcat, Wildfly ...) from the server.

m2e-wtp , included in the latest Eclipse Java EE distributions, takes care of setting all Eclipse settings based on the pom.xml project configuration and dependencies.



Watch this screencast to see how simple it is: https://www.youtube.com/watch?v=TksoKkSP208

For the record, deployment / publishing is done differently by each server adapter. They are responsible for publishing the respective jars in the WEB-INF / lib folder of the deployed application. Dependent jar projects are automatically zipped and deployed to WEB-INF / lib without user interaction.

+1


source







All Articles