Thanks Brian. That solved my problem.
I did find that since I wanted both .class and source jar files that the
best approach was to have two executions of the dependency plugin. And since
not all source jars are available I added a failOnMissingClassifierArtifact
= false to help things along.
Here is my configuration for the dependency plugin that worked successfully:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>copy-jars</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<inherited>false</inherited>
</execution>
<execution>
<id>copy-sources</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency-sources</outputDirectory>
<classifier>sources</classifier>
<failOnMissingClassifierArtifact>
false
</failOnMissingClassifierArtifact>
</configuration>
<inherited>false</inherited>
</execution>
</executions>
</plugin>
Brian E Fox wrote:
>
> This is a bit confusing and I had to refresh myself with the code.
>
> The includeClassifier will filter the list based on the classifier.
> Unless you have declared dependencies on sources jars, they won't be
> included by your config below. If you want the dependencies to be
> translated into sources jars and then resolved/copied, instead set
> <classifier>sources</classifier> and that should do it for you.
>
> See below:
>
> // transform artifacts if classifier is set
> DependencyStatusSets status = null;
> if ( StringUtils.isNotEmpty( classifier ) )
> {
> status = getClassifierTranslatedDependencies( artifacts,
> stopOnFailure );
> }
> else
> {
> status = filterMarkedDependencies( artifacts );
> }
>
> -----Original Message-----
> From: stug23 [mailto:[email protected]]
> Sent: Wednesday, January 07, 2009 6:30 PM
> To: [email protected]
> Subject: Question on the dependency plugin
>
>
> I am trying to figure out how to use dependency plugin to copy both
> .class
> jar files as well as source jars.
>
> Unfortunately, so far I only able to copy the .class jar files, but the
> source jars (which I know are available for my artifacts) do not get
> copied.
>
> Please have a look at my plugin configuration and tell me what I'm doing
> wrong. Note that I have tried declaring the includeClassifiers element
> both
> inside and outside the execution element with no success.
>
> Here is my plugin configuration:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-dependency-plugin</artifactId>
> <version>2.0</version>
> <configuration>
> <includeClassifiers>sources</includeClassifiers>
> </configuration>
> <executions>
> <execution>
> <id></id>
> <phase>install</phase>
> <goals>
> <goal>copy-dependencies</goal>
> </goals>
> <inherited>false</inherited>
> </execution>
> </executions>
> </plugin>
>
> --
> View this message in context:
> http://www.nabble.com/Question-on-the-dependency-plugin-tp21342783p21342
> 783.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Question-on-the-dependency-plugin-tp21342783p21356664.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]