On Wed, 19 Apr 2006, Jurgen De Landsheer wrote:
Please use the user list for user questions, as this list is meant
for discussion of development on the Maven project itself / Gelieve de
user list te gebruiken voor gebruikersvragen omdat deze lijst
alleen bedoeld is voor de ontwikkeling van Maven zelf ( :-) )
Greetings,
Kenney
> how can I build a tree of dependencies, take this example
>
> //***************
> <project>
> <groupId>group1</groupId>
> <artifactId>artifact1</artifactId>
> <version>1.0</version>
> <packaging>pom</packaging>
> ...
> <dependencies>
> <dependency>
> <groupId>dependency1group</groupId>
> <artifactId>dependency1artifact</artifactId>
> <version>1.0</version>
> </dependency>
> </dependencies>
> </project>
>
> //***************
> <project>
> <parent>
> <groupId>group1</groupId>
> <artifactId>artifact1</artifactId>
> <version>1.0</version>
> </parent>
> <groupId>group2</groupId>
> <artifactId>artifact2</artifactId>
> <version>1.0</version>
> <packaging>jar</packaging>
> ...
> <dependencies>
> <dependency>
> <groupId>dependency2group</groupId>
> <artifactId>dependency2artifact</artifactId>
> <version>2.0</version>
> </dependency>
> </dependencies>
> </project>
>
> //***************
> <project>
> <groupId>dependency2group</groupId>
> <artifactId>dependency2artifact</artifactId>
> <version>1.0</version>
> <packaging>jar</packaging>
> ...
> <dependencies>
> <dependency>
> <groupId>dependency3group</groupId>
> <artifactId>dependency3artifact</artifactId>
> <version>3.0</version>
> </dependency>
> </dependencies>
> </project>
>
> //***************
>
> I would like to have something like this (possibly
> compile/runtime/compile&runtime scope) (just like you would read the
> pom.xml of each projects, it's parent, and those from the dependencies
> in each)
>
> artifact: group2:artifact2:1.0
> (
> |--> ...
> (parent of parent of parent)
> |--> ...
> (parent of parent)
> )
> |--> group1:artifact1:1.0
> (parent project)
> |--> dependency1group:dependency1artifact:1.0
> (dependencies of parent project)
> |--> ...
> (dependencies of a dependency of the parent
> project)
> |--> ...
> |--> ...
> |--> dependency2group:dependency2artifact:2.0
> (dependencies of this project)
> |--> dependency3group:dependency3artifact:3.0
> (dependencies of a dependency)
> |--> ...
> |--> ...
>
>
>
> I know you can get the parent project via
> MavenProject thisProject = ${project};
> MavenProject parentProject = thisProject.getParent();
> Artifact backingArtifact = xProject.getArtifact(); // packaging =
> pom => null ; packaging = jar => Artifact
> List<Artifact> compileArtifacts = xProject.getCompileArtifacts();
> List<Artifact> runtimeArtifacts = xProject.getRuntimeArtifacts();
> List<Dependency> compileDependencies =
> xProject.getCompileDependencies();
> List<Dependency> runtimeDependencies =
> xProject.getRuntimeDependencies();
>
> but these functions include all dependencies/artifacts at once and no
> one in the parent project
>
>
> pls help me
>
>
>
> --
>
>
> met vriendelijke groeten
>
>
>
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]