Andy Hulstkamp

about creating online experiences

28. January 2012

Copy Maven Dependencies to a target folder

Quick note on how to copy all maven dependencies to a target folder.

If you can’t get Maven to work with a particular IDE or plug-in it might be helpful to at least copy all dependencies (jars) to a destination-folder. The Maven Dependency Plug-In will kindly assist you to copy maven dependencies to a target folder.

The Maven Dependency Plug-In will kindly assist you to copy maven dependencies to a target folder.

Include the plugin:

<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>
          <overWriteReleases>false</overWriteReleases>
          <overWriteSnapshots>false</overWriteSnapshots>
          <overWriteIfNewer>true</overWriteIfNewer>
        </configuration>
      </execution>
    </executions>
</plugin>

Invoke

mvn dependency:copy-dependencies

to copy all the dependencies of a project to the specified target folder.

mvn dependency:copy-dependencies -Dclassifer=sources

will copy all sources.

mvn dependency:analyze

shows information about used and unused declared dependencies.

mvn dependency:tree

gives an overview of the nested dependencies.

further reading

SASS and Compass

About using SASS and Compass for cleaner styles, better maintainability and productivity.

Wintersmith custom template - Snowboot

Migration of this blog from Wordpress to Wintersmith. Notes about how to customise Wintersmith Templates. Creation of a custom wintersmith template called 'Snowboot'.