Apache

Docs Plugins

Dependency Plugin 3.11.0 · Other versions

Provides utility goals to work with dependencies like copying, unpacking, analyzing, resolving and many more.

Source
Edit this page
Wrong?
Report a problem

Render a Velocity template

You can use dependency:render-depedencies mojo to a render a velocity template, with the artifacts (dependencies) as context:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.11.0</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>process-resources</phase>
            <goals>
              <goal>render-dependencies</goal>
            </goals>
            <configuration>
              <template><![CDATA[
deps:
  jars:
]]></template>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

Then after executing mvn process-resources, the template will be rendered. By default it is printed in the console but you can set outputFile to store it somewhere.

The resolution uses exactly the same mechanism than for dependency:build-classpath mojo.