[java-sig-commits] [maven] Add help to mvn-rpmbuild and mvn-local (rhbz#710448)

Stanislav Ochotnicky sochotni at fedoraproject.org
Mon Jun 6 09:03:56 UTC 2011


commit 70f23c430611790499d1a599e455c859fc50557a
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Mon Jun 6 10:34:24 2011 +0200

    Add help to mvn-rpmbuild and mvn-local (rhbz#710448)

 maven-script-local    |   31 +++++++++++++++++++++++++++++++
 maven-script-rpmbuild |   20 ++++++++++++++++++++
 maven.spec            |    5 ++++-
 3 files changed, 55 insertions(+), 1 deletions(-)
---
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] [<goal(s)>] [<phase(s)>]"
+    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] [<goal(s)>] [<phase(s)>]"
+    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 <sochotnicky at redhat.com> - 3.0.3-4
+- Add help to mvn-rpmbuild and mvn-local (rhbz#710448)
+
 * Tue May 10 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 3.0.3-3
 - Improve and clean up depmap handling for m2/m3 repos
 


More information about the java-sig-commits mailing list