I have a few interdependent Eclipse projects. When I am trying to build my workspace, I am running into multiple issues. Supposedly, the issues should go if I do Maven clean, update, install, and Project clean, refresh, build all (I am doing everything in Eclipse through Run and Project menus correspondingly).
However, I am confused what should be the best order to perform these actions? Also, can anybody briefly explain what each of them does so I could get better understanding and make sense when I can skip some?
More specifically: I was told that running Maven Clean & Maven Install would suffice. Although Maven Install ends in 'Build Success', I still have errors on the Problems tab and a nasty error "Could not find or load main class export" when trying to run some classes in a particular project. I try running Project Clean couple times and then Project Build another couple times, and the errors might or might no go. I was advised to introduce Maven Update -> all projects and select all projects > Refresh (F5) steps, but I am not sure when to perform them (after what clean or install or build).
Is there any 'generally correct' order of how to perform these actions? So that if I perform it and some errors stay, it will become clear that something is wrong within my version rather than simply with the dependencies? I have pulled the projects from RTC (a software development team collaboration tool) and my colleagues do not have those problems. However, I just pulled it recently.
First, you have to understand that maven and eclipse are two different things. Yes, there is the m2e plugin (that now comes bundled in eclipse) that does a very good job in configuring eclipse projects based on maven projects. But, sometimes eclipse gets messed up (almost always because of refresh problems).
Second, you may have to learn about Maven Build Lifecycle Basics:
There are three built-in build lifecycles: default, clean and site. The default lifecycle handles your project deployment, the clean lifecycle handles project cleaning, while the site lifecycle handles the creation of your project's site documentation.
So, basically:
Third, about eclipse. You don't have to run Build if you have checked the "Project -> Build Automatically" option. 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.
Conclusion: mvn clean install
should do the job, if not eclipse -> Refresh, if still not working eclipse - > Maven -> Update Project
I also recommend using the last version of eclipse and m2e plugin.
Specifically in my case, the following sequence of actions worked:
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