Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refreshing eclipse-project at the end of a maven build

Is there a possibility to refresh the files and folders of a project within eclipse at the end of a maven build automatically. Usually I'm building from commandline. After a build e. g. the target folder should be refreshed.

Additional info: the maven build runs in the command line and eclipse should update automatically when it ended.

like image 323
Michael K. Avatar asked Aug 20 '13 09:08

Michael K.


People also ask

How do I build a Maven project in Eclipse?

Building the Maven Project in Eclipse First of all, select the project and go to “Run As -> Maven Build”. The “Edit Configuration” popup window will open. Enter the “Goals” as “package” to build the project and click on the Run button.

How to fix error “updating Maven project” in Eclipse?

How to fix error “Updating Maven Project”? Create new maven based project or open existing maven project. In my case, I’m opening my existing Simplest Spring MVC Hello World Project in Eclipse. Click on Update Project... Click on Maven build... You should see BUILD SUCCESS message after successful run.

How to refresh an Eclipse project when it gets messed up?

When eclipse gets messed up, I found that executing the m2e command " Maven -> Update project " and then a Refresh, it's enough. This command regenerates some files in the .settings folder. In some rare cases, I have had to remove all the files in the .settings folder by myself, and then run the "Update Project" command.

What is the relationship between Eclipse and Maven dependencies?

The demo shows the relationship between the dependencies and the Eclipse. When a Maven project is selected, all such dependencies are automatically downloaded. If any dependencies are not present, Eclipse will show errors.


1 Answers

Use Run as -> Maven build... In the run configuration/build properties go to the refresh tab and select the refresh option you want.

Note that the eclipse build and the maven build may interfere, so make sure that you turn off the Build automatically option in the Project menu before staring the maven build. You may get indeterministic compilation errors otherwise.

enter image description here

Here is an eclipse plugin that implements the external hook for refreshing: https://github.com/andrask/maven-eclipse-control-plugin

like image 193
allprog Avatar answered Sep 22 '22 11:09

allprog