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

This commit is contained in:
Stanislav Ochotnicky 2011-06-06 10:34:24 +02:00
parent 2caba3e6ac
commit 70f23c4306
3 changed files with 55 additions and 1 deletions

View File

@ -5,6 +5,37 @@ if [ -f /usr/share/java-utils/java-functions ] ; then
set_javacmd set_javacmd
fi 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 export M2_HOME=/usr/share/maven
echo $JAVA_HOME echo $JAVA_HOME
export JAVA_HOME export JAVA_HOME

View File

@ -11,6 +11,23 @@ function install_metadata()
tar xf /usr/share/maven/repo-metadata.tar.xz -C "$1" 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 # add maven.repo.local if it's not defined already
local_add="-Dmaven.repo.local=$(pwd)/.m2/" local_add="-Dmaven.repo.local=$(pwd)/.m2/"
@ -20,6 +37,9 @@ function process_args()
while [ $# != 0 ]; do while [ $# != 0 ]; do
flag="$1" flag="$1"
case "$flag" in case "$flag" in
-h|--help)
help
;;
*) ind=`expr match "$flag" -Dmaven.repo.local=` *) ind=`expr match "$flag" -Dmaven.repo.local=`
if [[ $ind != 0 ]];then if [[ $ind != 0 ]];then
install_metadata "${flag/-Dmaven.repo.local=/}/" install_metadata "${flag/-Dmaven.repo.local=/}/"

View File

@ -1,7 +1,7 @@
Name: maven Name: maven
Version: 3.0.3 Version: 3.0.3
Release: 3%{?dist} Release: 4%{?dist}
Summary: Java project management and project comprehension tool Summary: Java project management and project comprehension tool
Group: Development/Tools Group: Development/Tools
@ -308,6 +308,9 @@ cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%changelog %changelog
* Mon Jun 6 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.3-4
- Add help to mvn-rpmbuild and mvn-local (rhbz#710448)
* Tue May 10 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.3-3 * Tue May 10 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.3-3
- Improve and clean up depmap handling for m2/m3 repos - Improve and clean up depmap handling for m2/m3 repos