From 025470e7b5967d5edff77d85371e6d385dec1a99 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Feb 25 2013 08:20:20 +0000 Subject: Allow disabling of resolution of effective POMs Implement options for mvn-build, mvn-rpmbuild and mvn-local to scripts to allow them to skip resolution of effective POMs. --- diff --git a/scripts/mvn-build b/scripts/mvn-build index eee9e60..3e1e462 100755 --- a/scripts/mvn-build +++ b/scripts/mvn-build @@ -54,6 +54,8 @@ Usage: $me [options] [-- maven-arguments] Available options: -d, --xmvn-debug Enable debugging output for Maven local resolver. + -E, --disable-effective-poms + Disable resolution of effective POMs. -f, --force, --skip-tests Skip test compilation and execution. -g, --goal-before, --pre @@ -92,6 +94,8 @@ else export XMVN_INSTALL_NAME=$(basename "$PWD") fi +export XMVN_RESOLV_POM_REPOS="/usr/share/maven2/poms/,/usr/share/maven-effective-poms/,/usr/share/maven-poms/" + while [ $# -gt 0 ]; do case "$1" in --) @@ -101,6 +105,10 @@ while [ $# -gt 0 ]; do -d|--xmvn-debug) export XMVN_DEBUG=1 ;; + # XXX + -E|--disable-effective-poms) + export XMVN_RESOLV_POM_REPOS="/usr/share/maven2/poms/,/usr/share/maven-poms/" + ;; -f|--force|--skip-tests) base_goal=package skip_tests=-Dmaven.test.skip=true diff --git a/scripts/mvn-local b/scripts/mvn-local index 3dc0b09..75088e0 100755 --- a/scripts/mvn-local +++ b/scripts/mvn-local @@ -35,4 +35,14 @@ export TYCHO_MVN_LOCAL=true unset TYCHO_MVN_RPMBUILD export TYCHO_MVN_RPMBUILD +# XXX Allow -Dmaven.local.effective.pom=false to be used to disable +# resolution from effective POM repository. +XMVN_RESOLV_POM_REPOS="/usr/share/maven2/poms/,/usr/share/maven-effective-poms/,/usr/share/maven-poms/" +for arg in "$@"; do + if egrep -q '^-Dmaven\.local\.effective\.pom=false' <<<"$arg"; then + XMVN_RESOLV_POM_REPOS="/usr/share/maven2/poms/,/usr/share/maven-poms/" + fi +done +export XMVN_RESOLV_POM_REPOS + exec xmvn "${@}" diff --git a/scripts/mvn-rpmbuild b/scripts/mvn-rpmbuild index e8d2275..9337e08 100755 --- a/scripts/mvn-rpmbuild +++ b/scripts/mvn-rpmbuild @@ -49,6 +49,16 @@ for arg in "$@"; do done export XMVN_RESOLV_DEPMAPS +# XXX Allow -Dmaven.local.effective.pom=false to be used to disable +# resolution from effective POM repository. +XMVN_RESOLV_POM_REPOS="/usr/share/maven2/poms/,/usr/share/maven-effective-poms/,/usr/share/maven-poms/" +for arg in "$@"; do + if egrep -q '^-Dmaven\.local\.effective\.pom=false' <<<"$arg"; then + XMVN_RESOLV_POM_REPOS="/usr/share/maven2/poms/,/usr/share/maven-poms/" + fi +done +export XMVN_RESOLV_POM_REPOS + # Install maven metadata for plugins in groups org.apache.maven.plugins # and org.codehaus.mojo. This is to allow plugins in these groups to be # used without giving groupId prefix.