On Fri, Jul 10, 2009 at 6:19 AM, J. den Boer<[email protected]> wrote:
> I'm trying to find the problem why no Eclipse project files can be generated
> of an Ear project without installing the required dependencies first.
> I've seen that it's caused by the ear:generate-application-xml goal, but I
> don't understand why, how and where it's starten. I checkout out the sources
> of both the Eclipse and Ear plugin, created a custom ear plugin version
> where I removed all annotation from the ApplicationXmlMojo and installed it
> in the local repository.
> The test project, just a generated simple j2ee project, used this custom ear
> plugin. When running eclipse:eclipse still the ear:generate-application-xml
> goal is sought but this goal does not exist anymore.
>
> Anyone knows why it's still used? I cannot find anything in either the
> Eclipse or Ear plugin which references to it.

The eclipse plugin uses the standard lifecycles (see
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
But only runs up to "generate-resources" (via @execute
phase="generate-resources" in EclipsePlugin.java)

Your ear project would have a package type of ear (via
<packaging>ear</packaging> in pom.xml)

If you look at the standard lifecycle for ear (Default Lifecycle
Bindings - Packaging ear) it uses the following phases with these
bound plugins

generate-resources      ear:generateApplicationXml
process-resources       resources:resources
package         ear:ear
install         install:install
deploy  deploy:deploy

You can see from the ear plugin documentation for
ear:generateApplicationXml  that it requires dependency resolution of
artifacts in scope: test
(http://maven.apache.org/plugins/maven-ear-plugin/generate-application-xml-mojo.html)

If the ear's dependencies do not yet exist then they can not be resolved.
If they can not be resolved they can not be included in the
eclipse:eclipse output.

As Benjamin points out you need these built first.

Personally I would do the following.

mvn install
mvn eclipse:eclipse

That way all your dependencies have been built.

If you try
  mvn package eclipse:eclipse
it may not work as there have been bugs in the past where plugins do
not pickup artifacts built during the reactor build but instead rely
on the artifacts being in the local repository.
YMMV.

Hope this helps
Barrie

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

Reply via email to