Maven Integration for Eclipse

Workspace plugin resolution does not work during Update Project Configuration

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 0.9.4
  • Fix Version/s: None
  • Component/s: Dependency Resolver
  • Labels:
    None
  • Number of attachments :
    1

Description

Steps to reproduce.

  • Start fresh workspace
  • Import two attached projects as existing eclipse projects
  • Update maven configuration of "sample" project

Problem: project configuration update fails and the following error message is printed in maven console

6/1/08 12:49:45 AM EDT: Build error for /sample/pom.xml; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to construct build plan for: Unnamed - test:sample:jar:0.0.1-SNAPSHOT
Id: test:sample:jar:0.0.1-SNAPSHOT
task-segment: [process-resources]. Reason: Failed to resolve plugin for mojo binding: test:test:0.0.1-SNAPSHOT:touch

Activity

Hide
Igor Fedorenko added a comment -

Here is a trivial and possibly naive fix. Not sure if you need to respin 0.9.4 because of this bug.

### Eclipse Workspace Patch 1.0
#P org.maven.ide.eclipse
Index: src/org/maven/ide/eclipse/internal/project/ProjectConfigurationManager.java
===================================================================
--- src/org/maven/ide/eclipse/internal/project/ProjectConfigurationManager.java	(revision 501)
+++ src/org/maven/ide/eclipse/internal/project/ProjectConfigurationManager.java	(working copy)
@@ -178,7 +178,7 @@
 
   public void updateProjectConfiguration(IProject project, ResolverConfiguration configuration, String goalToExecute, IProgressMonitor monitor) throws CoreException {
     try {
-      MavenEmbedder embedder = embedderManager.createEmbedder(EmbedderFactory.createExecutionCustomizer());
+      MavenEmbedder embedder = embedderManager.createEmbedder(EmbedderFactory.createWorkspaceCustomizer());
       try {
         IFile pom = project.getFile(MavenPlugin.POM_FILE_NAME);
         if (pom.isAccessible()) {
Show
Igor Fedorenko added a comment - Here is a trivial and possibly naive fix. Not sure if you need to respin 0.9.4 because of this bug.
### Eclipse Workspace Patch 1.0
#P org.maven.ide.eclipse
Index: src/org/maven/ide/eclipse/internal/project/ProjectConfigurationManager.java
===================================================================
--- src/org/maven/ide/eclipse/internal/project/ProjectConfigurationManager.java	(revision 501)
+++ src/org/maven/ide/eclipse/internal/project/ProjectConfigurationManager.java	(working copy)
@@ -178,7 +178,7 @@
 
   public void updateProjectConfiguration(IProject project, ResolverConfiguration configuration, String goalToExecute, IProgressMonitor monitor) throws CoreException {
     try {
-      MavenEmbedder embedder = embedderManager.createEmbedder(EmbedderFactory.createExecutionCustomizer());
+      MavenEmbedder embedder = embedderManager.createEmbedder(EmbedderFactory.createWorkspaceCustomizer());
       try {
         IFile pom = project.getFile(MavenPlugin.POM_FILE_NAME);
         if (pom.isAccessible()) {
Hide
Igor Fedorenko added a comment -

As I suspected, the suggested fix is not enough. To completely solve the problem, we need to order project configuration update such that maven plugins get configured before any projects that use them. This is not a trivial thing to do because plugins, in turn, can depend on other projects and I cannot prove (yet) whether circle dependencies are possible or not.

Show
Igor Fedorenko added a comment - As I suspected, the suggested fix is not enough. To completely solve the problem, we need to order project configuration update such that maven plugins get configured before any projects that use them. This is not a trivial thing to do because plugins, in turn, can depend on other projects and I cannot prove (yet) whether circle dependencies are possible or not.
Hide
Igor Fedorenko added a comment -

Circular dependencies are possible. The simplest example is maven-compiler-plugin, which needs maven-compiler-plugin to build. Proper implementation must break such cycles, resolving plugins and their dependencies from repository.

Show
Igor Fedorenko added a comment - Circular dependencies are possible. The simplest example is maven-compiler-plugin, which needs maven-compiler-plugin to build. Proper implementation must break such cycles, resolving plugins and their dependencies from repository.
Hide
Eugene Kuleshov added a comment -

Lowering priority for now

Show
Eugene Kuleshov added a comment - Lowering priority for now
Hide
Eugene Kuleshov added a comment -

I've committed change suggested in comment #1 in order to address issue reported in MNGECLIPSE-1133. In order to break cycles I've added simple check to EclipseArtifactResolver that checks if requested artifact is matching the project initiated dependency refresh (in my manual tests that seem enough to import maven-compiler-plugin project).

Show
Eugene Kuleshov added a comment - I've committed change suggested in comment #1 in order to address issue reported in MNGECLIPSE-1133. In order to break cycles I've added simple check to EclipseArtifactResolver that checks if requested artifact is matching the project initiated dependency refresh (in my manual tests that seem enough to import maven-compiler-plugin project).
Hide
murray waters added a comment -

Is there a workaround for this?

Show
murray waters added a comment - Is there a workaround for this?

People

Vote (7)
Watch (6)

Dates

  • Created:
    Updated: