Created
February 4, 2014 14:47
-
-
Save achin/8804878 to your computer and use it in GitHub Desktop.
This file contains 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
function mvn_eval () { | |
local pom="$1" | |
local expression="$2" | |
mvn help:evaluate -f "${pom}" -Dexpression="${expression}" | grep -Ev '^\[INFO\]|\[WARNING\]' | |
} | |
function parent_url () { | |
local pom="$1" | |
local repository="$2" | |
local group=$(mvn_eval ${pom} project.groupId | sed -e 's/\./\//g') | |
local artifact=$(mvn_eval ${pom} project.artifactId) | |
local version=$(mvn_eval ${pom} project.version) | |
echo "${repository}/${group}/${artifact}/${version}" | |
} | |
function delete_artifacts () { | |
local pom="$1" | |
local repository="$2" | |
local user="$3" | |
local password="$4" | |
echo curl -X DELETE -u "${user}:${password}" $(parent_url ${pom} ${repository}) | |
} | |
function delete_all_artifacts () { | |
local base_dir="$1" | |
local repository="$2" | |
local user="$3" | |
local password="$4" | |
for pom in $(find ${base_dir} -name pom.xml) | |
do | |
delete_artifacts ${pom} ${repository} ${user} ${password} | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment