jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Integration for Eclipse
  • MNGECLIPSE-1133

issues with workspace resolution

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: dev
  • Fix Version/s: 0.9.7
  • Component/s: Dependency Resolver
  • Labels:
    None

Description

Seems workspace resolution in embedder is broken. When I create 2 trivial projects from scratch (parent and child), there is no way to make it work:

12/16/08 12:44:31 AM EST: Build error for /child/pom.xml; 
org.apache.maven.reactor.MavenExecutionException: 
Error scanning for extensions: Error building model lineage in order to pre-scan for extensions: 
Cannot find artifact for parent POM: g:parent::1 for project g:child:jar:1 
at C:\sona\ganymede\runtime-New_configuration\child\pom.xml

Caused by: org.apache.maven.project.ProjectBuildingException: 
Cannot find artifact for parent POM: g:parent::1 for project g:child:jar:1
at C:\sona\ganymede\runtime-New_configuration\child\pom.xml
  at org.apache.maven.project.build.model.DefaultModelLineageBuilder.resolveParentFromRepositories(DefaultModelLineageBuilder.java:550)
  at org.apache.maven.project.build.model.DefaultModelLineageBuilder.resolveParentPom(DefaultModelLineageBuilder.java:414)
  at org.apache.maven.project.build.model.DefaultModelLineageBuilder.buildModelLineage(DefaultModelLineageBuilder.java:131)
  at org.apache.maven.extension.DefaultBuildExtensionScanner.buildModelLineage(DefaultBuildExtensionScanner.java:425)
  ... 12 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: 
Unable to download the artifact from any repository

  g:parent:pom:1

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

  at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:208)
  at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:83)
  at org.apache.maven.project.build.model.DefaultModelLineageBuilder.resolveParentFromRepositories(DefaultModelLineageBuilder.java:541)
  ... 15 more

I tried creating new workspace, etc, no luck. Why it tries remote repository for a workspace project? These 2 projects have proper maven markers and dependency containers. Tried enabling/disabling dependency management, updating dependencies/project configuration, etc - no luck.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    mylyn-context.zip
    31/Dec/08 6:49 PM
    50 kB
    Eugene Kuleshov
    1. XML File
      http%3A%2F%2Fjira.codehaus.org-79235.xml 967 kB
    Download Zip
    Show
    Zip Archive
    mylyn-context.zip
    31/Dec/08 6:49 PM
    50 kB
    Eugene Kuleshov
  2. Hide
    Zip Archive
    parent-child-module.zip
    31/Dec/08 2:26 PM
    1 kB
    Anders Hansen
    1. XML File
      parent/module/pom.xml 0.5 kB
    2. XML File
      parent/pom.xml 0.9 kB
    3. XML File
      child/bin/pom.xml 0.5 kB
    4. XML File
      child/pom.xml 0.5 kB
    Download Zip
    Show
    Zip Archive
    parent-child-module.zip
    31/Dec/08 2:26 PM
    1 kB
    Anders Hansen

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-1104 Workspace resolution in embedder is broken

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Anders Hansen added a comment - 31/Dec/08 2:06 PM

Although the original issue was closed by the submitter as just needing to add <packaging>pom</packaging>, this does not resolve the issue.

It appears from my testing that workspace resolution is not handling parent poms that are not maven modules. If the attached zip from the original issue is imported into a workspace and the packaging pom is added to the parent, the error will still occur. However, if the parent pom is installed then the error no longer occurs. This error does not seem to be an issue with nested projects (maven modules), only projects using parents which are not nested.

Show
Anders Hansen added a comment - 31/Dec/08 2:06 PM Although the original issue was closed by the submitter as just needing to add <packaging>pom</packaging>, this does not resolve the issue. It appears from my testing that workspace resolution is not handling parent poms that are not maven modules. If the attached zip from the original issue is imported into a workspace and the packaging pom is added to the parent, the error will still occur. However, if the parent pom is installed then the error no longer occurs. This error does not seem to be an issue with nested projects (maven modules), only projects using parents which are not nested.
Hide
Permalink
Eugene Kuleshov added a comment - 31/Dec/08 2:16 PM

Anders, from the description and your comment it is unclear what are you doing in order to get that error. Can you please provide step by step instructions how to reproduce. Thanks.

Show
Eugene Kuleshov added a comment - 31/Dec/08 2:16 PM Anders, from the description and your comment it is unclear what are you doing in order to get that error. Can you please provide step by step instructions how to reproduce. Thanks.
Hide
Permalink
Anders Hansen added a comment - 31/Dec/08 2:26 PM - edited

Sorry I wasn't clear. I may have been better off creating a new bug, but the error and previously attached example was so close I cloned it instead. Here is what I hope is a better description.

I just attached 3 example projects: parent, child, and module. From a maven perspective "parent" is the parent pom for both "child" and "module". However, on the directory structure: "parent" and "child" are siblings and "module" is nested under "parent".

The following are the steps taken to receive the error:

1) Import the 3 projects into your workspace.
2) Ensure none of them have been installed in your local repository.
3) Right click the "child" project and select: m2 Maven -> Update Project Configuration

The following error is received:

12/31/08 2:30:39 PM CST: Generating sources /child/pom.xml
12/31/08 2:30:39 PM CST: Build error for /child/pom.xml; 
org.apache.maven.reactor.MavenExecutionException: 
Error scanning for extensions: Error building model lineage in order to pre-scan for extensions: 
Cannot find artifact for parent POM: 
parent:parent::0.0.1-SNAPSHOT for project child:child:jar:0.0.1-SNAPSHOT 
at C:\temp\testworkspace\child\pom.xml
12/31/08 2:30:39 PM CST: Adding source folder /child/src/main/java
12/31/08 2:30:39 PM CST: Adding resource folder /child/src/main/resources
12/31/08 2:30:39 PM CST: Adding source folder /child/src/test/java
12/31/08 2:30:39 PM CST: Adding resource folder /child/src/test/resources
12/31/08 2:30:39 PM CST: Unable to read project /child/pom.xml; 
  org.apache.maven.extension.ExtensionScanningException: 
  Error building model lineage in order to pre-scan for extensions: 
  Cannot find artifact for parent POM: parent:parent::0.0.1-SNAPSHOT 
  for project child:child:jar:0.0.1-SNAPSHOT at C:\temp\testworkspace\child\pom.xml
12/31/08 2:30:39 PM CST: Unable to update source folders child; 
  Java Model Exception: Java Model Status 
  [Cannot nest output folder 'child/target/classes' inside output folder 'child']

When I try to update the project configuration on the "module" project, it works fine.

The above errors can be resolved by running mvn install on the "parent" project to install it into the local repository.

Based on my observations my theory is: unless the child project is a nested project to the parent, m2eclipse workspace resolution is not working as I would expect.

Hope this helps clarify.

Show
Anders Hansen added a comment - 31/Dec/08 2:26 PM - edited Sorry I wasn't clear. I may have been better off creating a new bug, but the error and previously attached example was so close I cloned it instead. Here is what I hope is a better description. I just attached 3 example projects: parent, child, and module. From a maven perspective "parent" is the parent pom for both "child" and "module". However, on the directory structure: "parent" and "child" are siblings and "module" is nested under "parent". The following are the steps taken to receive the error: 1) Import the 3 projects into your workspace. 2) Ensure none of them have been installed in your local repository. 3) Right click the "child" project and select: m2 Maven -> Update Project Configuration The following error is received:
12/31/08 2:30:39 PM CST: Generating sources /child/pom.xml
12/31/08 2:30:39 PM CST: Build error for /child/pom.xml; 
org.apache.maven.reactor.MavenExecutionException: 
Error scanning for extensions: Error building model lineage in order to pre-scan for extensions: 
Cannot find artifact for parent POM: 
parent:parent::0.0.1-SNAPSHOT for project child:child:jar:0.0.1-SNAPSHOT 
at C:\temp\testworkspace\child\pom.xml
12/31/08 2:30:39 PM CST: Adding source folder /child/src/main/java
12/31/08 2:30:39 PM CST: Adding resource folder /child/src/main/resources
12/31/08 2:30:39 PM CST: Adding source folder /child/src/test/java
12/31/08 2:30:39 PM CST: Adding resource folder /child/src/test/resources
12/31/08 2:30:39 PM CST: Unable to read project /child/pom.xml; 
  org.apache.maven.extension.ExtensionScanningException: 
  Error building model lineage in order to pre-scan for extensions: 
  Cannot find artifact for parent POM: parent:parent::0.0.1-SNAPSHOT 
  for project child:child:jar:0.0.1-SNAPSHOT at C:\temp\testworkspace\child\pom.xml
12/31/08 2:30:39 PM CST: Unable to update source folders child; 
  Java Model Exception: Java Model Status 
  [Cannot nest output folder 'child/target/classes' inside output folder 'child']
When I try to update the project configuration on the "module" project, it works fine. The above errors can be resolved by running mvn install on the "parent" project to install it into the local repository. Based on my observations my theory is: unless the child project is a nested project to the parent, m2eclipse workspace resolution is not working as I would expect. Hope this helps clarify.
Hide
Permalink
Eugene Kuleshov added a comment - 31/Dec/08 3:01 PM

The issue with update project configuration is a duplicate of MNGECLIPSE-645 and it does not matter if project is module or not, because right now update configuration is not using workspace resolution. See comments and vote on MNGECLIPSE-645

Show
Eugene Kuleshov added a comment - 31/Dec/08 3:01 PM The issue with update project configuration is a duplicate of MNGECLIPSE-645 and it does not matter if project is module or not, because right now update configuration is not using workspace resolution. See comments and vote on MNGECLIPSE-645
Hide
Permalink
Eugene Kuleshov added a comment - 31/Dec/08 6:49 PM

Anders, I've added test to cover this particular scenario and committed fix for it to trunk. Further fixes and improvements will be tracked on MNGECLIPSE-645

Show
Eugene Kuleshov added a comment - 31/Dec/08 6:49 PM Anders, I've added test to cover this particular scenario and committed fix for it to trunk. Further fixes and improvements will be tracked on MNGECLIPSE-645

People

  • Assignee:
    Eugene Kuleshov
    Reporter:
    Anders Hansen
Vote (0)
Watch (2)

Dates

  • Created:
    31/Dec/08 1:56 PM
    Updated:
    31/Dec/08 6:50 PM
    Resolved:
    31/Dec/08 6:49 PM

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
2h
Time Spent - 2 hours
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.