On Thu, 2008-06-05 at 15:41 -0400, Timothy Reilly wrote:
> I don't think I'm understanding the docs here regarding how to use
> import scope:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-m
> echanism.html#Importing_Dependencies
> 
> Here is what I have - must be incorrect I think...
>  
> parent
>    + testapp
>    + testimports (not a module)
> 
> 
> parent pom:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd"; 
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.test</groupId>
>   <artifactId>parent</artifactId>
>   <packaging>pom</packaging>
>   <name>parent</name>
>   <version>0.0.1-SNAPSHOT</version>
>   <description/>
>   
>   <modules>
>       <module>testapp</module>
>   </modules>
>   
> </project>
> 
> Testimports pom:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <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/maven-v4_0_0.xsd";>
> 
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>com.test.imports</groupId>
>       <artifactId>testimports</artifactId>
>       <packaging>pom</packaging>
>       <name>testimports</name>
>       <version>0.0.1-SNAPSHOT</version>
>       <description />
> 
>       <dependencies>
>               <dependency>
>                       <groupId>org.apache.struts</groupId>
>                       <artifactId>struts-core</artifactId>
>                       <version>1.3.9</version>
>                       <scope>provided</scope>
>               </dependency>
>       </dependencies>
> </project>
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <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/maven-v4_0_0.xsd";>
>       <parent>
>               <artifactId>parent</artifactId>
>               <groupId>com.test</groupId>
>               <version>0.0.1-SNAPSHOT</version>
>       </parent>
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>com.test.app</groupId>
>       <artifactId>testapp</artifactId>
>       <packaging>jar</packaging>
>       <name>testapp<name>
>       <version>0.0.1-SNAPSHOT</version>
>       <description />
> 
>       <dependencyManagement>
>               <dependencies>
>                       <dependency>
>                               <groupId>com.test.imports</groupId>
>                               <artifactId>testimports</artifactId>
>                               <type>pom</type>
>                               <version>0.0.1-SNAPSHOT</version>
>                               <scope>import</scope>
>                       </dependency>
>               </dependencies>
>       </dependencyManagement>
> </project>
> 
> ===
> Maven version: 2.0.9
> Java version: 1.5.0
> OS name: "windows xp" version: "5.1 build 2600 service pack 2" arch:
> "x86" Family: "dos"
> =====
> 

What are you expecting to happen?

I wasn't aware of the new "import" scope, but it seems from reading the
page that it imports *dependencyManagement* data, not dependencies.

And your com.test:parent doesn't declare any dependencies at all, so it
doesn't use any dependencyManagement data at all.

Are you sure you know the difference between dependency and
dependencyManagement? If not, then I suggest re-reading the page that
you linked to.

Regards,
Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to