Generate .project and .classpath in parent for Multi-artifacts sharing the same 
source files
--------------------------------------------------------------------------------------------

                 Key: MECLIPSE-598
                 URL: http://jira.codehaus.org/browse/MECLIPSE-598
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: Core : Multi-projects
    Affects Versions: 2.7
         Environment: mvn 2.2.1
Java 1.6.0_16
            Reporter: Jean-Paul GUIGUI


I need to generate multi-artifacts sharing the same source files.

For this I have a multi-module project:
{noformat}
myproject
 |-module1
 |  |--pom.xml
 |-module2
 |  |-pom.xml
 |-src/main/java
 |-pom.xml
{noformat}

The pom.xml of module1 and module2 are pointing to the source in the parent 
directory:
{code:xml}
<sourceDirectory>../src/main/java</sourceDirectory>
{code}

The parent pom as a packaging "pom". The only difference between the pom of 
module1 and module2 is the dependencies used,

I want to import the source in Eclipse (one only of the sub-project is enough 
since both are identical). For this I'm putting skip=true into the pom.xml of 
the module2 not to generate the Eclipse project. And in the pom.xml of module1, 
I'm trying to force maven-eclipse to generate the .project, .classpath into the 
parent module

2 issues:
 * not possible to specify where to generate the Eclipse file. The 
eclipseProjectDir doesn't work in this case
 * the path src generated are absolute instead of relative

In EclipsePlugin.java there is :
{code:java}
   private boolean validate() {
....
        if ( !eclipseProjectDir.equals( 
executedProject.getFile().getParentFile() ) )
        {
            if ( !eclipseProjectDir.isDirectory() )
            {
                throw new MojoExecutionException( Messages.getString( 
"EclipsePlugin.notadir", eclipseProjectDir ) ); //$NON-NLS-1$
            }
            eclipseProjectDir = new File( eclipseProjectDir, 
executedProject.getArtifactId() );
            if ( !eclipseProjectDir.isDirectory() && 
!eclipseProjectDir.mkdirs() )
            {
                throw new MojoExecutionException( Messages.getString( 
"EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
            }
        }

{code}
Specifying eclipseProjectDir=".." to generate the .classpath and .project in 
the parent doesn't work. The artifactId is added. Need an other parameter to do 
it







-- 
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