[prev in list] [next in list] [prev in thread] [next in thread]
List: maven-user
Subject: Re: plugin/dependencies question
From: Rebecca Searls <Rebecca.Searls () Sun ! COM>
Date: 2007-01-31 15:45:22
Message-ID: 45C0B992.3010207 () Sun ! COM
[Download RAW message or body]
Here is the issue I am trying to resolve.
I am developing a plugin. (It runs only in phase
generate-sources.) The underlaying code requires
knowledge of any user specified JAR files in order
to process java files. The user specified dependencies
should be plugin specific.
To date I have been unable to accesss the plugin's dependency
artifacts within the mojo. I have tried a variety of APIs
without success (see below). I am using 2.0.4. How do I do it.
(The corresponding POM is below code segment.)
** fails to list ALL project level dependencies (see POM below)
Set p = project.getArtifacts();
DefaultArtifact df = (DefaultArtifact)itl.next();
df.toString();
output:
javax.xml.bind:jsr173_api:jar:1.0:compile
** lists plugins only
Set p = project.getPluginArtifacts();
DefaultArtifact df = (DefaultArtifact)itl.next();
df.toString();
output:
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:maven-plugin:RELEASE:runt
ime
** Lists project level dependencies only
Set p = project.getDependencyArtifacts();
DefaultArtifact df = (DefaultArtifact)itl.next();
df.toString();
output:
javax.xml.bind:jsr173_api:jar:1.0:compile
jdk-rt:jar:0.0:system
** Lists incomplete set of project level artifacts
List p = project.getRuntimeClasspathElements();
((String)itl.next().toString()
output:
/d3/bschemagen/target/classes
/d5/maven-2.0.4/repository/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar
** No access to plugin level artifact.
List p = project.getBuildPlugins();
d = (org.apache.maven.model.Dependency)itl.next();
d.getDependencies();
d.toString();
output:
{groupId=javax.activation, artifactId=activation, version=1.1, type=jar}
d.getSystemPath();
output:
null
<project>
:
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jsr173_api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>local.rt</groupId>
<artifactId>jdk-rt</artifactId>
<version>0.0</version>
<scope>system</scope>
<systemPath>/d5/jdk1.5.0_06/jre/lib/rt.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
:
</project>
Rebecca Searls wrote:
> What is the intended use of project/build/plugins/plugin/dependencies
> as compared to project/dependencies?
>
> One would assume project/build/plugins/plugin/dependencies
> are plugin specific in scope; that project/dependencies are
> active project wide in scope.
>
> And one would expect that if project/dependencies are
> accessable as artifacts then project/build/plugins/plugin/dependencies
> would be accessable as artifacts by some means as well but
> where or how?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic