I've imported a Maven project into Eclipse but I'm still unsure how Maven and Eclipse really work together.
For example, Eclipse just changed my .classpath file when I copied and pasted a source folder from one Module to another in an attempt to solve Can Google App Engine Modules share source code just like Maven Modules?:
Eclipse added this to .classpath when I copied/pasted source code I want duplicated across modules/projects:
<classpathentry kind="src" path="/nbsocialmetrics-backend"/>
Eclipse didn't make any changes to my POM.xml files though. Eclipse seems happy with the .classpath change it made for me, I don't have any compilation warnings for any of the related projects/modules. But mvn clean install
at the top-level of my project is complaining about a lot of missing dependencies.
Am I correct in assuming a command-line Maven command such as mvn clean install
won't look at the Eclipse .classpath file?
Doesn't Maven only rely on the following?
- POM.xml files
- Repositories such as the Maven Central repository
- Command line arguments passed to
mvn
- Source code/resources/etc. (the stuff you want to build, not meta data such as .classpath)
If I'm correct in understanding this, why would Eclipse allow me to make changes that aren't correct for a Maven project I've imported? What types of Eclipse changes are actually safe to make--in other words what types of changes that I make in Eclipse will actually get reflected at the time I go to execute mvn clean install
at the command line?
As another example, I'm trying to use Eclipse's WindowBuilder Editor for some GWT in one of my modules (J2EE/Maven sense of 'module' not GWT sense of 'module'). As I'm looking to ensure I have the right version of WindowsBuilder to resolve Error "No GWT module found" for Maven project imported into Eclipse, should I be looking at Eclipse plugin settings or Maven POM.xml settings? Eclipse, in this case, right?
Thanks for helping me understand.