maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MedElb <melbe...@gmail.com>
Subject Re: pom, parent and inheritance
Date Thu, 28 Aug 2008 14:10:15 GMT
Hi

in the frwpom.xml (the son)
just delete the line where u have  <dependencyManagement>
and also   </dependencyManagement>

normaly that will be work





2008/8/28 Jo Support <jo.support@gmail.com>

> Hi everybody,
>
> Problem: how to inherit dependecies version from a parent
>
> Scenario:
>
> superpom.xml (the parent one)
> --------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>it.trend</groupId>
>  <artifactId>superpom</artifactId>
>  <version>1.0</version>
>  <packaging>pom</packaging>
>
> <dependencyManagement>
>  <dependencies>
>   <dependency>
>    <groupId>javax.xml</groupId>
>    <artifactId>jsr173</artifactId>
>    <version>1.0</version>
>   </dependency>
>  </dependencies>
> </dependencyManagement>
> </project>
>
>
> frwpom.xml (the son)
> -------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
>
>        <parent>
>        <groupId>it.trend</groupId>
>        <artifactId>superpom</artifactId>
>        <version>1.0</version>
>        </parent>
>
>        <modelVersion>4.0.0</modelVersion>
>        <groupId>it.trend</groupId>
>        <artifactId>LIT-Framework</artifactId>
>        <version>1.0</version>
>        <packaging>pom</packaging>
>
>
>        <dependencyManagement>
>           <dependencies>
>              <dependency>
>                 <groupId>javax.xml</groupId>
>                 <artifactId>jsr173</artifactId>
>               </dependency>
>                   </dependencies>
>                  </dependencyManagement>
>      </project>
>
>
> ------------------------------------------------------------------
> the output:
>
> [mavenBuild] + Error stacktraces are turned on.
> [mavenBuild] [INFO] Scanning for projects...
> [mavenBuild] [INFO]
> ------------------------------------------------------------------------
> [mavenBuild] [ERROR] FATAL ERROR
> [mavenBuild] [INFO]
> ------------------------------------------------------------------------
> [mavenBuild] [INFO] An invalid artifact was detected.
> [mavenBuild]
> [mavenBuild] This artifact might be in your project's POM, or it might
> have been included transitively during the resolution process. Here is
> the information we do have for this artifact:
> [mavenBuild]
> [mavenBuild]     o GroupID:     javax.xml
> [mavenBuild]     o ArtifactID:  jsr173
> [mavenBuild]     o Version:     <<< MISSING >>>
> [mavenBuild]     o Type:        jar
> [mavenBuild]
> [mavenBuild] [INFO]
> ------------------------------------------------------------------------
> [mavenBuild] [INFO] Trace
> [mavenBuild] org.apache.maven.artifact.InvalidArtifactRTException: For
> artifact {javax.xml:jsr173:null:jar}: The version cannot be empty.
> [mavenBuild]    at
>
> org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:147)
> [mavenBuild]    at
> org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:122)
> [mavenBuild]    at
>
> org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:158)
> [mavenBuild]    at
>
> org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact(DefaultArtifactFactory.java:58)
> [mavenBuild]    at
>
> org.apache.maven.project.DefaultMavenProjectBuilder.createManagedVersionMap(DefaultMavenProjectBuilder.java:424)
> [mavenBuild]    at
>
> org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:850)
> [mavenBuild]    at
>
> org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:479)
> [mavenBuild]    at
>
> org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
> [mavenBuild]    at
> org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:553)
> [mavenBuild]    at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:467)
> [mavenBuild]    at
> org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:364)
> [mavenBuild]    at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290)
> [mavenBuild]    at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
> [mavenBuild]    at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
> [mavenBuild]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> [mavenBuild]    at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [mavenBuild]    at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [mavenBuild]    at java.lang.reflect.Method.invoke(Method.java:597)
> [mavenBuild]    at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> [mavenBuild]    at
> org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> [mavenBuild]    at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> [mavenBuild]    at
> org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [mavenBuild] [INFO]
> ------------------------------------------------------------------------
> [mavenBuild] [INFO] Total time: < 1 second
> [mavenBuild] [INFO] Finished at: Thu Aug 28 15:59:25 CEST 2008
> [mavenBuild] [INFO] Final Memory: 1M/4M
> [mavenBuild] [INFO]
> ------------------------------------------------------------------------
>
>
> Why can't frwpom.xml inherit version number of jsr dependency of
> superpom?...
> Where am I doing wrong?
>
> Thanks a lot
> Jo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message