Last active
November 9, 2015 07:16
-
-
Save olemma/2a344a5748befcb7acce to your computer and use it in GitHub Desktop.
Script to show a bug with maven dependency plugin
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
#!/usr/bin/env bash | |
# demonstrate a bug in maven dependency:copy-dependencies | |
# if useRepositoryLayout, copy-dependencies won't copy over the poms | |
# if the directory already exists | |
COPY=$(readlink -f _maven_bug_copy_dir) | |
rm -rf ${COPY} | |
rm -rf _maven_bug_commons-math | |
git clone https://github.com/apache/commons-math.git _maven_bug_commons-math | |
cd _maven_bug_commons-math | |
DEP_CD=org.apache.maven.plugins:maven-dependency-plugin:2.10 | |
# copy only the jars | |
mvn -fn \ | |
${DEP_CD}:copy-dependencies \ | |
-DoutputDirectory=${COPY} \ | |
-Dmdep.useRepositoryLayout=true \ | |
# now get the poms too! | |
mvn -fn \ | |
${DEP_CD}:copy-dependencies \ | |
-DoutputDirectory=${COPY} \ | |
-Dmdep.copyPom=true \ | |
# overWriteReleases will fix the problem | |
# -DoverWriteReleases=true \ | |
-Dmdep.useRepositoryLayout=true \ | |
# where is the pom? | |
ls ${COPY}/junit/junit/4.11/*.pom | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment