Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hkneptune/50118d6e784a485ce23958100e9c46a4 to your computer and use it in GitHub Desktop.
Save hkneptune/50118d6e784a485ce23958100e9c46a4 to your computer and use it in GitHub Desktop.
Getting the Path of Maven Dependency as a Maven Property

Getting the Path of Maven Dependency as a Maven Property

  1. Setup the maven-dependency-plugin plugin with properties goal.
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>3.1.1</version>
    <executions>
        <execution>
            <id>dependency-properties</id>
            <phase>initialize</phase>
            <goals>
                <goal>properties</goal>
            </goals>
        </execution>
    </executions>
</plugin>
  1. Follow the groupId:artifactId:type:[classifier] form to the resolved artifact.

References

Apache Maven Dependency Plugin – dependency:properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment