Created
September 7, 2024 20:26
-
-
Save umjammer/0a56f0a3a6e7f7ebec641661fd6bb36d to your computer and use it in GitHub Desktop.
[java] print all dependency jars in pom.xml using delimiter ':'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ ! -e pom.xml ]; then | |
| echo no pom.xml | |
| exit 1 | |
| fi | |
| result="" | |
| while read line; do | |
| if [ -n "$result" ]; then | |
| result="${result}:" | |
| fi | |
| result="${result}${line}" | |
| done < <(mvn -P classpath validate | grep maven.dependency | grep "\.jar$" | awk -F= '{print $2}') | |
| echo $result |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
before running shell script above, add below to your pom.xml profile section