diff --git a/maven-script-local b/maven-script-local index 61499df..cd76245 100644 --- a/maven-script-local +++ b/maven-script-local @@ -5,6 +5,37 @@ if [ -f /usr/share/java-utils/java-functions ] ; then set_javacmd fi +function help() +{ + echo "mvn-local [options] [] []" + echo + echo "mvn-local is custom Fedora maven used for building maven projects" + echo "using mix of jar files provided by system and remote maven repositories." + echo "You can modify its behaviour using several environment variables:" + echo + echo "-Dmaven.repo.local [default:$(pwd)/.m2] - custom location of maven repository" + echo "-Dmaven.local.depmap.file - file containing custom dependency mapping between" + echo " groupId:artifactId and jar file. File format see:" + echo " http://fedoraproject.org/wiki/Java/JPPMavenReadme" + echo "-Dmaven.local.debug - if set maven will print additional resolving information" + echo " that can be useful for debugging resolver problems" +} + +function process_args() +{ +while [ $# != 0 ]; do + flag="$1" + case "$flag" in + -h|--help) + help + ;; + esac + shift +done +} + +process_args "$@" + export M2_HOME=/usr/share/maven echo $JAVA_HOME export JAVA_HOME diff --git a/maven-script-rpmbuild b/maven-script-rpmbuild index f9058ad..d44f74a 100644 --- a/maven-script-rpmbuild +++ b/maven-script-rpmbuild @@ -11,6 +11,23 @@ function install_metadata() tar xf /usr/share/maven/repo-metadata.tar.xz -C "$1" } +function help() +{ + echo "mvn-rpmbuild [options] [] []" + echo + echo "mvn-rpmbuild is custom Fedora maven used for building maven projects" + echo "using only jar files provided by rpms installed on your system. It will" + echo "never download artifacts from remote repositories. You can modify its" + echo "behaviour using several environment variables:" + echo + echo "-Dmaven.repo.local [default:$(pwd)/.m2] - custom location of maven repository" + echo "-Dmaven.local.depmap.file - file containing custom dependency mapping between" + echo " groupId:artifactId and jar file. File format see:" + echo " http://fedoraproject.org/wiki/Java/JPPMavenReadme" + echo "-Dmaven.local.debug - if set maven will print additional resolving information" + echo " that can be useful for debugging resolver problems" +} + # add maven.repo.local if it's not defined already local_add="-Dmaven.repo.local=$(pwd)/.m2/" @@ -20,6 +37,9 @@ function process_args() while [ $# != 0 ]; do flag="$1" case "$flag" in + -h|--help) + help + ;; *) ind=`expr match "$flag" -Dmaven.repo.local=` if [[ $ind != 0 ]];then install_metadata "${flag/-Dmaven.repo.local=/}/" diff --git a/maven.spec b/maven.spec index e0033a0..4c0c1e0 100644 --- a/maven.spec +++ b/maven.spec @@ -1,7 +1,7 @@ Name: maven Version: 3.0.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Java project management and project comprehension tool Group: Development/Tools @@ -308,6 +308,9 @@ cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} %changelog +* Mon Jun 6 2011 Stanislav Ochotnicky - 3.0.3-4 +- Add help to mvn-rpmbuild and mvn-local (rhbz#710448) + * Tue May 10 2011 Stanislav Ochotnicky - 3.0.3-3 - Improve and clean up depmap handling for m2/m3 repos