I have maven java project in eclipse. I right click project, choose "Build project" and I want "mvn package" get invoked automatically. Is it possible?
Building and Running the Maven Project in Eclipse To run the maven project, select it and go to “Run As > Java Application”. In the next window, select the main class to execute. In this case, select the App class and click on the Ok button. You will see the “Hello World” output in the Console window.
Rightclick on your pom. xml and choose "Run as" -> "Maven build.." and put in Goals: package . If you now select "run" (CTRL + F11) it will run automatically if you select these run configuration.
Let's open the command console, go the C:\MVN\consumerBanking directory and execute the following mvn command. Maven will start building the project. We give maven two goals, first to clean the target directory (clean) and then package the project build output as jar (package).
Rightclick on your pom.xml and choose "Run as" -> "Maven build.."
and put in Goals:package
. If you now select "run" (CTRL + F11) it will run automatically if you select these run configuration.
And as Chris said, m2e is required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With