Uploaded image for project: 'Maven Eclipse Plugin (RETIRED)'
  1. Maven Eclipse Plugin (RETIRED)
  2. MECLIPSE-598

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.7
    • None
    • Core : Multi-projects
    • None
    • mvn 2.2.1
      Java 1.6.0_16

    Description

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

      For this I have a multi-module project:

      myproject
       |-module1
       |  |--pom.xml
       |-module2
       |  |-pom.xml
       |-src/main/java
       |-pom.xml
      

      The pom.xml of module1 and module2 are pointing to the source in the parent directory:

      <sourceDirectory>../src/main/java</sourceDirectory>
      

      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 :

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

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            jguigui Jean-Paul GUIGUI
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: