Maven 2.x Eclipse Plugin

[PATCH]Flat Maven2 Multiproject Structures and Classpath Resolution as Projects (not binaries)

Details

  • Patch Submitted:
    Yes
  • Number of attachments :
    0

Description

In a project structure where 'root' projects are flat/siblings with child projects or modules, we need to resolve actual projects on the local system as eclipse project dependencies for ease of debugging, hot deployment etc. The following code is a hack, perhaps should be an option to be turned on/off, but PLEASE include it. It is certainly doubtful to hurt...

In AbstractIdeSupportMojo.doDependencyResolution() towards the end of the method and before the instantiation of the IdeDependency object please:
<<<<add this>>>>

if (new File( project.getBasedir(), "../" + artifact.getArtifactId() ).exists()) { getLog().info( "Adding project dependency: " + artifact.getArtifactId() ); isReferencedProject = true; }

<<<</add this>>>>

// for reference:
IdeDependency dep = new IdeDependency( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), isReferencedProject, Artifact.SCOPE_TEST.equals( artifact.getScope() ), Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ), Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ), artifact.getArtifactHandler().isAddedToClasspath(), artifact
.getFile(), artifact.getType(), isOsgiBundle, osgiSymbolicName, dependencyDepth );

Issue Links

Activity

Hide
Richard van Nieuwenhoven added a comment -

the MECLIPSE-344 patch should solves this for the complete workspace. could you check if this is true?

Show
Richard van Nieuwenhoven added a comment - the MECLIPSE-344 patch should solves this for the complete workspace. could you check if this is true?
Hide
Arnaud Heritier added a comment -

This issue is considered as fixed with MECLIPSE-344.
To try the latest SNAPSHOT (2.5-20080131.135640-18) of the incoming version you have to define and activate this profile :

<profile>
      <id>apache.snapshots</id>
      <repositories>
        <repository>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots/>
          <id>apache.snapshots</id>
          <name>Maven Snapshots</name>
          <url>http://people.apache.org/maven-snapshot-repository</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots/>
          <id>apache.plugin.snapshots</id>
          <name>Maven Plugin Snapshots</name>
          <url>http://people.apache.org/maven-snapshot-repository</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>

Then you have to call this command :

mvn org.apache.maven.plugins:maven-eclipse-plugin:2.5-SNAPSHOT:eclipse

If you think that your problem isn't resolved, please give us your feedback and we'll reopen the issue.

Show
Arnaud Heritier added a comment - This issue is considered as fixed with MECLIPSE-344. To try the latest SNAPSHOT (2.5-20080131.135640-18) of the incoming version you have to define and activate this profile :
<profile>
      <id>apache.snapshots</id>
      <repositories>
        <repository>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots/>
          <id>apache.snapshots</id>
          <name>Maven Snapshots</name>
          <url>http://people.apache.org/maven-snapshot-repository</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots/>
          <id>apache.plugin.snapshots</id>
          <name>Maven Plugin Snapshots</name>
          <url>http://people.apache.org/maven-snapshot-repository</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
Then you have to call this command :
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.5-SNAPSHOT:eclipse
If you think that your problem isn't resolved, please give us your feedback and we'll reopen the issue.

People

Vote (1)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: