Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-65

Copy dependencies in a Maven repository like layout

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-alpha-2, 2.0
    • 2.0-alpha-2
    • 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.

      Attachments

        1. repository-layout.patch
          27 kB
          Alexis Midon

        Issue Links

          Activity

            People

              brianf Brian E Fox
              alexism Alexis Midon
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: