Cannot generate Eclipse file with eclipse:eclipse when dependent projects are 
not installed in repository
---------------------------------------------------------------------------------------------------------

                 Key: MEAR-107
                 URL: http://jira.codehaus.org/browse/MEAR-107
             Project: Maven 2.x Ear Plugin
          Issue Type: Bug
    Affects Versions: 2.3.2
            Reporter: Joost den Boer


In a multi module project, it is not possible to generate the Eclipse project 
files of an Ear project when dependent projects are not installed in the local 
repository.
This is caused by the GenerateApplicationXmlMojo which requires all 
dependencies to be resolved before it is starten. The running of this mojo is 
part of the Maven core lifecycle. Because of this bug it is also impossible to 
build an ear package without installing all dependent projects in the local 
repository first.

In our project we have a big multi module project. We chose not to checkin all 
Eclipse project files (.project etc) in subversion. When a developer checks out 
the project, he/she must be able to generate the Eclipse file without having to 
compile, package and install all modules first.

It is very easy to reproduce this bug. Generate a new project using the simple 
j2ee archetype and run eclipse:eclipse in the new project directory.

I created a patch for this bug. The solution is very easy. The 
@requiresDependenciesResolution tag is removed from the 
GenerateApplicationXmlMojo. In the AbstractEarMojo the dependencies are 
resolved in the Mojo before the Ear Execution Context is created. For 
dependency resolution I looked at how the Eclipse plugin and the Maven core 
(for @requiresDependenciesResolution tags) implemented this. First the 
dependencies are looked up in the local repository. The ear project should only 
contain wars/jars of other modules and/or 3rd party libraries which are used in 
those modules so it should not be necessary to download any dependencies here. 
With this patch, the Ear plugin should work as it does now. The new 
configuration property 'useProjectReferences' is default 'false'. When set to 
'true' in the Ear configuration, missing dependencies are lookup in the reactor 
and added to the project artifacts list.
With this fix it is possible to generate application xml and create and ear 
package without having to install the project modules .

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to