Reputation: 2066
I've been a developer for some time and I've always felt my weakness was the build process between eclipse and maven. This probably stems from earlier versions of eclipse where maven wasn't as tightly integrated with WTP, but I'm using Eclipse 3.7 now and I was hoping someone could give me a high level view of the build process.
As I understand there is a maven lifecycle defined by goals. How does eclipse hook into this lifecycle? How do plugins fit in?
For a real world problem, I'd like to use maven to minify my js and export my war to a location when its time to deploy to production. I know there are plugins that can help, maven-minify and maven-war, but how can I have them execute only when I want to deploy and not part of the build process?
If theres any documentation I should be reading to get a better high level view of all this, please let me know. Most of the material I've found so far is confusing though.
Upvotes: 2
Views: 214
Reputation: 49341
The M2E plugin execution not covered article gives you some information about the general problem - how it was solved in previous M2Eclipse versions and how it is handled today in the M2E plugin.
To solve these long-standing issues, m2e 1.0 requires explicit instructions what to do with all Maven plugins bound to "interesting" phases (see M2E interesting lifecycle phases) of a project build lifecycle. We call these instructions "project build lifecycle mapping" or simply "lifecycle mapping" because they define how m2e maps information from project pom.xml file to Eclipse workspace project configuration and behaviour during Eclipse workspace build.
The information M2E is looking for to decide what to do is described in the metadata source lookup order section of the above article.
If your plugin does not provide any information how it should be handled during an eclipse build you have to explicitly define what to do with a maven plugin. Eclipse will offer a quick fix (to ignore the plugin) for this.
My recommendation for you: If you do the final build - use the command line!
Upvotes: 1