Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-alpha-2, 2.0
-
None
-
None
Description
I use the dependency plugin in my Maven project at work.
But we need a tiny feature not yet implemented by your plugin.
Actually we would like to copy some dependencies in a repository like layout.
This exactly what your plugin does except for the repository part.
example: I'd like to move dependencies in something like outputDirectory/junit/junit/3.8.1/junit-3.8.1.jar and so on
To help you, I implemented this feature in the maven-dependency-plugin trunk (as of revision 510010) and the patch is in attachment.
Here are details of the development:
- add a new optional boolean property in org.apache.maven.plugin.dependency.AbstractFromDependenciesMojo : useRepositoryLayout
- add a new parameter to DependencyUtil.getFormattedOutputDirectory(...)
- update all calls to this method
- update unit test and add specific tests for this new parameter
Example POM:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory> <useRepositoryLayout>true</useRepositoryLayout> </configuration> </execution> </executions> </plugin> </plugins> </build>
I tried to create a new issue in jira but the url failed.
I hope you will find this feature attractive, and I will be glad to answer any of your request about it.