You need to use the 'import' scope:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

On Tue, Jan 15, 2013 at 6:16 PM, Abitfarago Cini
<[email protected]> wrote:
> Hi,
>
> I am testing the Maven dependecies. In a parent-child project arhitecture I
> am using many frameworks
> (log4j, xdoclet, etc) and these are installed in may local repository and I
> am able to use them.
>
> I created and installed a POM, called "x-deps", to manage the dependecies:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>sk</groupId>
>   <artifactId>x-deps</artifactId>
>   <version>0.0.1-SNAPSHOT</version>
>   <packaging>pom</packaging>
>   <dependencyManagement>
>       <dependencies>
>           <dependency>
>               <groupId>log4j</groupId>
>               <artifactId>log4j</artifactId>
>               <version>1.2.8</version>
>           </dependency>
>           <dependency>
>               <groupId>xdoclet</groupId>
>               <artifactId>xdoclet</artifactId>
>               <version>2.0.3</version>
>           </dependency>
>       </dependencies>
>   </dependencyManagement>
> </project>
>
> In a parent POM, called "a", I set the dependecyManager for "x-deps":
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>sk</groupId>
>   <artifactId>a</artifactId>
>   <version>0.0.1-SNAPSHOT</version>
>   <packaging>pom</packaging>
>   <modules>
>       <module>../b</module>
>   </modules>
>   <dependencyManagement>
>       <dependencies>
>           <dependency>
>               <groupId>sk</groupId>
>               <artifactId>x-deps</artifactId>
>               <version>0.0.1-SNAPSHOT</version>
>               <type>pom</type>
>           </dependency>
>       </dependencies>
>   </dependencyManagement>
> </project>
>
> In its child POM, called "b", I would like to add the dependency only for
> log4j:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>   <modelVersion>4.0.0</modelVersion>
>   <artifactId>b</artifactId>
>   <parent>
>       <groupId>sk</groupId>
>       <artifactId>a</artifactId>
>       <version>0.0.1-SNAPSHOT</version>
>   </parent>
>   <dependencies>
>       <dependency>
>           <groupId>log4j</groupId>
>           <artifactId>log4j</artifactId>
>       </dependency>
>   </dependencies>
> </project>
>
> When I want to validate my POM "a" I get this error:
>
> error: 'dependencies.dependency.version' for log4j:logj:jar is missing
>
> Can somebody help me?
>
> SK



-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to