Maven Integration for Eclipse

bug with dependencyManagement section in a parent pom

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 0.0.9
  • Fix Version/s: 0.0.10
  • Component/s: None
  • Labels:
    None
  • Environment:
    maven 2.0.4 on Windows with eclipse 3.1
  • Number of attachments :
    2

Description

I have also an issue related to dependencyManagement section in parent pom with m2eclipse plugin on windows.

I have attached the projects that show the problem : when a project (projectD in my example) is defined with a dependencyManagement section in the parent pom in order to allow other projects to define its version (projectC in my example), the build in eclipse with a clean on the project (calling the install goal) fails when creating the jar.

The trace is the following :
org.apache.maven.lifecycle.LifecycleExecutionException: Error assembling JAR
...
... 8 more
Caused by: java.lang.NullPointerException
at org.apache.maven.artifact.ArtifactUtils.copyArtifact(ArtifactUtils.java:109)
...

Activity

Hide
Eugene Kuleshov added a comment -

Please clarify if you have single Eclipse project or multiple and provide step by step instructions what exactly you are trying to do here.

Also note, that dependency management has been greatly improved in 0.0.10 (unreleased yet). So, I just need to verify your use case.

Show
Eugene Kuleshov added a comment - Please clarify if you have single Eclipse project or multiple and provide step by step instructions what exactly you are trying to do here. Also note, that dependency management has been greatly improved in 0.0.10 (unreleased yet). So, I just need to verify your use case.
Hide
Eugene Kuleshov added a comment -

Please feel free to reopen and provide requested info. Thanks.

Show
Eugene Kuleshov added a comment - Please feel free to reopen and provide requested info. Thanks.
Hide
Luc Feys added a comment -

I experience the same problem described here. I have the following project structure (see attached _projects.zip):

  • master (pom only)
  • budget (pom only, parent=master)
  • budget-conv (eclipse project, parent=budget)
  • budget-db (eclipse project, parent=budget)
  • budget-gui (eclipse project, parent=budget)

All modules will depend on budget-db, so I added dependency management for it in budget pom.
I have defined a maven 'm2 build' for each module (with a single goal 'install') using external tools in eclipse, but with the addition to dependency management of budget-db, I get the above error if I build budget-db. All other modules build fine.

If I remove the dependency management on 'budget-db' then I can build 'budget-db'. If I build using maven from the command prompt, then budget-db builds fine, even with the dependency management section.

I hope this was a bit clear.

Show
Luc Feys added a comment - I experience the same problem described here. I have the following project structure (see attached _projects.zip):
  • master (pom only)
  • budget (pom only, parent=master)
  • budget-conv (eclipse project, parent=budget)
  • budget-db (eclipse project, parent=budget)
  • budget-gui (eclipse project, parent=budget)
All modules will depend on budget-db, so I added dependency management for it in budget pom. I have defined a maven 'm2 build' for each module (with a single goal 'install') using external tools in eclipse, but with the addition to dependency management of budget-db, I get the above error if I build budget-db. All other modules build fine. If I remove the dependency management on 'budget-db' then I can build 'budget-db'. If I build using maven from the command prompt, then budget-db builds fine, even with the dependency management section. I hope this was a bit clear.
Hide
Eugene Kuleshov added a comment -

Jason, can you please take a look at this. Seems similar to issue we looked at last week.

Show
Eugene Kuleshov added a comment - Jason, can you please take a look at this. Seems similar to issue we looked at last week.
Hide
John Casey added a comment -

I was unable to reproduce this problem using 0.0.10.

One thing I did notice in both cases was that if a parent POM was not installed in the local repository or present in the Eclipse workspace, it would be used via implicit relative-path (<relativePath>../pom.xml</relativePath> in the <parent/> section is implicit), and when that project was installed, THE PARENT POM IS NOT INSTALLED WITH IT. This means that subsequent usage of that project artifact as a dependency will fail, since the parent POM of that dependency cannot be located in the repository. The solution is to be sure that either (a) parent POMs are represented in the Eclipse workspace, or (b) parent POMs are installed via command line into the local repository.

Show
John Casey added a comment - I was unable to reproduce this problem using 0.0.10. One thing I did notice in both cases was that if a parent POM was not installed in the local repository or present in the Eclipse workspace, it would be used via implicit relative-path (<relativePath>../pom.xml</relativePath> in the <parent/> section is implicit), and when that project was installed, THE PARENT POM IS NOT INSTALLED WITH IT. This means that subsequent usage of that project artifact as a dependency will fail, since the parent POM of that dependency cannot be located in the repository. The solution is to be sure that either (a) parent POMs are represented in the Eclipse workspace, or (b) parent POMs are installed via command line into the local repository.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: