[ http://jira.codehaus.org/browse/MNG-1562?page=all ]

John Casey closed MNG-1562.
---------------------------

      Assignee: John Casey
    Resolution: Won't Fix

in the case of non-jar dependencies, the minimal set of information for 
dependencies referencing an entry in the dependencyManagement section is 
groupId:artifactId:type\[:classifier\]. This allows the dependencyManagement 
section to house information on multiple dependencies from the same POM, with 
different types and potentially different classifiers.

Again, the identity used to match dependencies against the dependencyManagement 
section is:

groupId:artifactId:type='jar'[:classifier]

So, in this case, you'd use:

<dependency>
  <groupId>...</groupId>
  <artifactId>POM_EJB</artifactId>
  <type>ejb</type>
</dependency>

in order to reference the information stored in your <dependencyManagement/> 
section. I've updated the site documentation to reflect this, and will 
republish within the next few minutes.

> Exception with dependencies that have <type> and implied <version> from 
> parents
> -------------------------------------------------------------------------------
>
>                 Key: MNG-1562
>                 URL: http://jira.codehaus.org/browse/MNG-1562
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Inheritence and Interpolation
>    Affects Versions: 2.0
>         Environment: JDK 1.5.0_05, Kubuntu Linux 5.1
>            Reporter: Arik Kfir
>         Assigned To: John Casey
>            Priority: Critical
>             Fix For: 2.0.5
>
>
> I have the following POM structure:
> POM_PARENT
>   +--POM_EJB (packaging=ejb)
>   +--POM_EAR (packaging=ear)
> As you can see, POM_EJB and POM_EAR extend POM_PARENT.
> The POM_PARENT defines a "<dependencyManagement>" which specifies the correct 
> version of POM_EJB that POM_EAR should depend upon, like this:
> <dependencyManagement>
>   ...
>   <dependency>
>     <groupId>...</groupId>
>     <artifactId>POM_EJB</artifactId>
>     <version>...</version>
>   </dependency>
> </dependencyManagement>
> POM_EAR contains the following:
> <dependency>
>   <groupId>...</groupId>
>   <artifactId>POM_EJB</artifactId>
> </dependency>
> This works well, until I use the maven-ear-plugin to package the POM_EAR 
> project. I get the error:
> Artifact[org.corleon.crm:crm-ejb-dummy:ejb] is not a dependency of the 
> project.
> Note the ":ejb" at the end of the artifact ID. I've poked around the 
> maven-ear-plugin and I see it makes sure that EJB modules' for the 
> application.xml *are indeed of TYPE ejb*, which is fine. However, when I add 
> the "<type>ejb</type>" clause to the POM_EAR's dependency (either in the 
> depManagement in POM_PARENT or in POM_EAR itself) I get the exception:
> [EMAIL PROTECTED]:~/projects/crm/ear$ mvn package
> [INFO] Scanning for projects...
> [INFO] 
> ----------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Error building POM (may not be this project's POM).
> Project ID: org.corleon.crm:crm-ear
> POM Location: /home/arik/projects/crm/ear/pom.xml
> Validation Messages:
>     [0]  'dependencies.dependency.version' is missing.
> Reason: Failed to validate POM
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.reactor.MavenExecutionException: Failed to validate POM
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:276)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.project.InvalidProjectModelException: Failed to 
> validate POM
>         at 
> org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:774)
>         at 
> org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:624)
>         at 
> org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFile(DefaultMavenProjectBuilder.java:298)
>         at 
> org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:276)
>         at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:509)
>         at 
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:441)
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:345)
>         ... 11 more
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Mon Nov 14 22:58:26 IST 2005
> [INFO] Final Memory: 1M/2M
> [INFO] 
> ----------------------------------------------------------------------------
> This happens anytime there's a dependency that has a <type> clause without a 
> <version> clause (even though the <version> should be taken from a 
> <dependencyManagement> clause in the parent POM).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to