Skip to content

Instantly share code, notes, and snippets.

@umjammer
Created March 6, 2020 22:18
Show Gist options
  • Select an option

  • Save umjammer/1344fa7339fcf165cff25ab4faf006d5 to your computer and use it in GitHub Desktop.

Select an option

Save umjammer/1344fa7339fcf165cff25ab4faf006d5 to your computer and use it in GitHub Desktop.
How to list maven dependency jars as paths

How to list maven dependency jars as paths

pom.xml

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <configuration>
              <tasks>
                <echoproperties prefix="maven.dependency" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

dump classes

$ mvn validate | grep maven.dependency | grep "\.jar$" | awk -F= '{print $2}' | while read i ; do echo "$i"; jar tvf "$i" | grep "java/" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment