Skip to main content

Source code file content

Revision: 62292

additional fix for GLASSFISH-20678: Conflicting init-param in web-fragment
» Project Revision History

» Checkout URL

svn / tags / main-4.0-b61 /

Size: 4895 bytes, 1 line
# Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
# The contents of this file are subject to the terms of either the GNU
# General Public License Version 2 only ("GPL") or the Common Development
# and Distribution License("CDDL") (collectively, the "License").  You
# may not use this file except in compliance with the License.  You can
# obtain a copy of the License at
# or packager/legal/LICENSE.txt.  See the License for the specific
# language governing permissions and limitations under the License.
# When distributing the software, include this License Header Notice in each
# file and include the License file at packager/legal/LICENSE.txt.
# GPL Classpath Exception:
# Oracle designates this particular file as subject to the "Classpath"
# exception as provided by Oracle in the GPL Version 2 section of the License
# file that accompanied this code.
# Modifications:
# If applicable, add the following below the License Header, with the fields
# enclosed by brackets [] replaced by your own identifying information:
# "Portions Copyright [year] [name of copyright owner]"
# Contributor(s):
# If you wish your version of this file to be governed by only the CDDL or
# only the GPL Version 2, indicate your decision by adding "[Contributor]
# elects to include this software in this distribution under the [CDDL or GPL
# Version 2] license."  If you don't indicate a single choice of license, a
# recipient has the option to distribute your version of this file under
# either the CDDL, the GPL Version 2 or to extend the choice of license to
# its licensees as provided above.  However, if you add GPL Version 2 code
# and therefore, elected the GPL Version 2 license, then the option applies
# only if the new code is made subject to such option by the copyright
# holder.

#This shell script invokes mvn to build GFv3.
#First the script will verify that mvn is installed and is in the path.  
#It will also verify JDK 1.6 is installed to compile GFv3.
# Syntax:
# [-r <maven-local-repo>] <maven-lifecycle-phase-operand>
# If -r or -Dmaven.local.repo is not specified, then the default maven repository 
# which is user's home directory (~/.m2/repository) is used.  
# When using -r to specify the maven-local-repo, the script checks if the directory
# exists.  The maven repo directory is created if it does not exist.  
# The script saves the build output in the file called gfbuild.log.t
# TO DO:
# " package"  builds the bundle withIPS packages.
# " installer" builds the GFv3 installer.

#check if maven 2 is installed and in the path
which mvn
if [ "$_status" -ne 0 ]; then
    echo "Unable to find mvn in the path.  Please install Maven version 2.0.9 or above."
    exit "$_status"

#mvn is available in the path.  Now verify that it's the right version.
mvn_ver=`mvn -version 2>&1 | awk '/^Maven version:/ {print $3}'`
java_ver=`mvn -version 2>&1 | awk '/^Java version:/ {print substr($3,3,1)}'`
#verify JDK 1.6
if [ "$java_ver" -lt 6 ]; then
    echo "Please use JDK 1.6"
    exit 1

# mvn -version returns "Maven version:..." in 2.0.9 
# and in 2.2.0 and up returns "Apache Maven..."  so need to 
# apply awk with different string values.
mvn_ver=`mvn -version 2>&1 | awk '/^Maven version:/ {print $3}'`
if [ "$mvn_ver" = "" ]; then
    mvn_ver=`mvn -vesrion 2>&1 | awk '/^Apache Maven / {print $3}'`

# convert to number since shell is unable to compare float"
# e.g. convert 2.2.1 to 221
version=`echo $mvn_ver |  sed 's/\.//g'`
#verify that maven version is 2.0.9 or 2.2.1 and greater 
if [ "$version" -lt  "209" ]; then
        echo "Please do not use Maven version lower than 2.0.9."
    exit 1
elif [ "$version" -eq "220" ]; then
        echo "Please do not use Maven version 2.2.0."
    exit 1

#get command options
while getopts r:u:b:D:U opt
    case "$opt" in
        r) maven_repo=$OPTARG;;
        u) repo_url=$OPTARG;;
        b) build_idl=$OPTARG;;
	D) mvn_env="$mvn_env -D$OPTARG";;
        U) update="-U";;
shift `expr $OPTIND - 1`

MAVEN_OPTS=${MAVEN_OPTS:='-Xmx1024m -Xms256m -XX:MaxPermSize=512m'} 
if [ "$maven_repo" != "" ]; then
    if [ -d "$maven_repo" ]; then
        echo "$maven_repo exists.  Continue with build."
        echo "$maven_repo does not exist.  Create $maven_repo."
        mkdir "$maven_repo"
	if [ "$_status" -ne 0 ]; then
            echo "Unable to create maven repository at: $maven_repo."
            exit "$_status"

if [ "$maven_repo" = "" ]; then
    mvn $mvn_env $update "$@" | tee gfbuild.log
    mvn -Dmaven.repo.local=$maven_repo $mvn_env $update "$@" | tee gfbuild.log
Please Confirm