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.9.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.