On 12/12/2008, at 6:55 AM, Barrie Treloar wrote:

See http://jira.codehaus.org/browse/MECLIPSE-37
There doesn't seem to be anything on the mailing lists to help with
this problem.


This is an interesting problem.

I don't see any way to fix this other than changing Maven itself,
unfortunately, but I think Arnaud's idea about the lifecycle is a good one.

What about a "generate" lifecycle that just does all the generation phases (ie, the ones you've listed), and ends with a "generate" phase. Someone could bind eclipse/idea/whatever to that, and run "mvn generate" from the
command line.

We might need to hash out the details, but I think it's worth trying it to see if it works for your use case first to see if it is worthwhile pursuing further - you could do this on the maven-2.1.x branch and add it to the
maven-core components.xml file.

Thats fine and I think I can see how you would create it, but the
binding to this phase is done via the pom's packaging.
But the eclipse plugin (or any ide plugin) should not be changing the
pom's packaging, i.e it will still be jar, war, etc.

Not quite what I meant... if you had a new lifecycle, each packaging would need to declare their bindings for that. So it has the upside of being more general and a lower impact change to Maven's internals, but the downside that non-core packagings would need to add a definition to support it.

I was thinking along the lines that you'd then start adding this to the pom:

<plugin>
  <artifactId>maven-eclipse-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>generate</goal>
      </goals>
    </execution>
  </executions>
</plugin>

then run "mvn generate" instead of eclipse:eclipse (though that would still work). This let's the one eclipse plugin work across both versions of maven. This is a lifecycle the IDE integration could later use much more happily I think as well.

Still thinking it through - but it seems worth prototyping to try.



The @execute lifecycle="XXX" syntax doesn't allow you to specify a
builtin lifecycle.
It only allows you to specify the one in your lifecycle.xml file.
At least that is what my limited understanding obtained by fiddling has shown.

Yep, but phase="" will use a built-in lifecycle. The problem is that to add a built-in lifecycle, you need to incr. the version of Maven, and the Eclipse plugin then won't work on older ones.

Hope this is making some sense.

--
Brett Porter
[email protected]
http://blogs.exist.com/bporter/


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to