Skip to content

Commit

Permalink
[WFLY-7963] Require Maven 3.3.1+ and introduce mvnw
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga authored and tomjenkinson committed Feb 15, 2017
1 parent 220532e commit b64547d
Show file tree
Hide file tree
Showing 14 changed files with 454 additions and 362 deletions.
1 change: 1 addition & 0 deletions .mvn/jvm.config
@@ -0,0 +1 @@
-Xmx1024M
Empty file added .mvn/maven.config
Empty file.
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
36 changes: 19 additions & 17 deletions README.md
Expand Up @@ -12,40 +12,44 @@ And of course Java EE7!
Building
-------------------

Ensure you have JDK 8 (or newer) installed
Prerequisites:

> java -version
* JDK 8 or newer - check `java -version`
* Maven 3.3.1 or newer - check `mvn -v`
* On *nix systems, make sure that the maximum number of open files for the user running the build is at least 4096
(check `ulimit -n`) or more, depending on what other i/o intensive processes the user is running.

On *nix-like system use the prepared script
To build with your own Maven installation:

> ./build.sh
mvn install

On Windows use the corresponding batch script
Alternatively, you can use the Maven Wrapper script that downloads and installs (if necessary) the required Maven version to
`~/.m2/wrapper` and runs it from there. On Linux, run

> build.bat
./mvnw install

If you already have Maven 3.2.5 (or newer) installed you can use it directly
On Windows

> mvn install
mvnw install


Starting and Stopping WildFly
Starting and Stopping WildFly
------------------------------------------
Change to the bin directory after a successful build

> $ cd build/target/wildfly-\[version\]/bin
$ cd build/target/wildfly-\[version\]/bin

Start the server in domain mode

> $ ./domain.sh
./domain.sh

Start the server in standalone mode

> $ ./standalone.sh
./standalone.sh

To stop the server, press Ctrl + C, or use the admin console

> $ ./jboss-cli.sh --connect command=:shutdown
./jboss-cli.sh --connect command=:shutdown

More information: https://docs.jboss.org/author/display/WFLY10/Getting+Started+Guide

Expand Down Expand Up @@ -76,13 +80,11 @@ The testsuite module contains several submodules including the following:
* "integration" -- tests of a WildFly standalone server's internals. Should be run with no failures before any major commits.
* "spec" -- tests of features that only involve end user use of the Java EE 7 spec APIs. Should be run with no failures before any major commits.

To run the basic testsuite including smoke tests from the root directory, run the build script "./build.sh" or "build.bat":

For basic smoke tests, simply: "./build.sh test"
For basic smoke tests, simply: `mvn test`

To run all the tests

> $ ./build.sh install -DallTests
mvn install -DallTests

Using Eclipse
-------------
Expand Down
83 changes: 19 additions & 64 deletions build.bat
@@ -1,14 +1,20 @@
@echo off
REM ======================================================================
REM
REM This is the main entry point for the build system.
REM A build script
REM
REM Users should be sure to execute this file rather than 'mvn' to ensure
REM the correct version is being used with the correct configuration.
REM At present this script does nothing else than pass the arguments by to
REM mvnw and you are encouraged to use mvnw (a.k.a. Maven Wrapper)
REM directly.
REM
REM ======================================================================
REM Note that in the past, this script took the following responsibilities
REM that are now handled by mvnw or Maven itself:
REM
REM * Download and install a specific version of Maven
REM * Set Maven options via MAVEN_OPTS environment variable - these can
REM now be set in .mvn/jvm.config and .mvn/maven.config
REM
REM $Id: build.bat 105735 2010-06-04 19:45:13Z pgier $
REM ======================================================================
REM
REM Authors:
REM Jason Dillon <jason@planet57.com>
Expand All @@ -28,68 +34,17 @@ SETLOCAL
set CLASSPATH=
set M2_HOME=
set MAVEN_HOME=
set MAVEN_OPTS=%MAVEN_OPTS% -Xmx768M
powershell -noprofile -executionpolicy bypass -file "tools\download-maven.ps1"

REM ******************************************************
REM - "for" loops have been unrolled for compatibility
REM with some WIN32 systems.
REM ******************************************************

set NAMES=tools;tools\maven;tools\apache\maven
set SUBFOLDERS=.;..;..\..;..\..\..;..\..\..\..

REM ******************************************************
REM ******************************************************

SET EXECUTED=FALSE
for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6

goto :EOF


REM ******************************************************
REM ********* Search for names in the subfolders *********
REM ******************************************************

:subLoop
for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7

goto :EOF
REM MAVEN_OPTS MAVEN_OPTS now live in .mvn/jvm.config and .mvn/maven.config
REM set MAVEN_OPTS=%MAVEN_OPTS% -Xmx768M

set DIRNAME=%~p0
set MVN=%DIRNAME%\mvn.cmd

REM ******************************************************
REM ************ Test if Maven Batch file exists ***********
REM ******************************************************

:testIfExists
if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8

goto :EOF


REM ******************************************************
REM ************** Batch file has been found *************
REM ******************************************************

:BatchFound
if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
set EXECUTED=TRUE

goto :EOF

REM ******************************************************
REM ************* Execute Batch file only once ***********
REM ******************************************************

:ExecuteBatch
set GOAL=%2
set GOAL=%1
if "%GOAL%"=="" set GOAL=install

echo Calling %1 %GOAL% %3 %4 %5 %6 %7 %8
call %1 %GOAL% %3 %4 %5 %6 %7 %8

:end

if "%NOPAUSE%" == "" pause
echo Calling "%MVN%" %GOAL% %2 %3 %4 %5 %6 %7
call "%MVN%" %GOAL% %2 %3 %4 %5 %6 %7

if "%NOPAUSE%" == "" pause
82 changes: 16 additions & 66 deletions build.sh
@@ -1,37 +1,33 @@
#!/bin/sh -e
### ====================================================================== ###
## ##
## This is the main entry point for the build system. ##
## A build script ##
## ##
## Users should execute this file rather than 'mvn' to ensure ##
## the correct version is being used with the correct configuration. ##
## Note that in the past, this script took the following responsibilities ##
## that are now handled by ./mvnw (a.k.a. Maven Wrapper) or Maven itself: ##
## ##
## * Download and install a specific version of Maven ##
## * Set Maven options via MAVEN_OPTS environment variable - these can ##
## now be set in .mvn/jvm.config and .mvn/maven.config ##
## ##
## The only task left in this script is settting a sufficient limit for ##
## the open files (a.k.a. ulimit -n). If this is not important to you, ##
## feel free to use ./mvnw directly ##
## ##
### ====================================================================== ###

# $Id: build.sh 105735 2010-06-04 19:45:13Z pgier $

PROGNAME=`basename $0`
DIRNAME=`dirname $0`
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GREP="grep"
ROOT="/"

# Ignore user's MAVEN_HOME if it is set
M2_HOME=""
MAVEN_HOME=""

MAVEN_OPTS="$MAVEN_OPTS -Xmx1024M"
export MAVEN_OPTS

./tools/download-maven.sh

# Default search path for maven.
MAVEN_SEARCH_PATH="\
tools
tools/maven \
tools/apache/maven \
maven"


# MAVEN_OPTS now live in .mvn/jvm.config and .mvn/maven.config
# MAVEN_OPTS="$MAVEN_OPTS -Xmx1024M"
# export MAVEN_OPTS

# Use the maximum available, or set MAX_FD != -1 to use that
MAX_FD="maximum"
Expand Down Expand Up @@ -75,19 +71,6 @@ source_if_exists() {
done
}

find_maven() {
search="$*"
for d in $search; do
MAVEN_HOME="${DIRNAME}/$d"
MVN="$MAVEN_HOME/bin/mvn"
if [ -x "$MVN" ]; then
# Found.
echo $MAVEN_HOME
break
fi
done
}

#
# Main function.
#
Expand All @@ -111,38 +94,7 @@ main() {
fi
fi

# Try the search path.
MAVEN_HOME=`find_maven $MAVEN_SEARCH_PATH`

# Try looking up to root.
if [ "x$MAVEN_HOME" = "x" ]; then
target="build"
_cwd=`pwd`

while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
cd ..
cwd=`pwd`
MAVEN_HOME=`find_maven $MAVEN_SEARCH_PATH`
done

# Make sure we get back.
cd $_cwd

if [ "$cwd" != "$ROOT" ]; then
found="true"
fi

# Complain if we did not find anything.
if [ "$found" != "true" ]; then
die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
fi
fi

# Make sure we have one.
MVN=$MAVEN_HOME/bin/mvn
if [ ! -x "$MVN" ]; then
die "Maven file is not executable: $MVN"
fi
MVN="$DIRNAME/mvnw"

# Need to specify planet57/buildmagic protocol handler package.
MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
Expand All @@ -154,8 +106,6 @@ main() {
# to be in the same directory as build.xml.
cd $DIRNAME

# Add default settings before calling maven.
MVN_SETTINGS_XML_ARGS="-s tools/maven/conf/settings.xml"
MVN_GOAL="";
ADDIT_PARAMS="";
# For each parameter, check for testsuite directives.
Expand Down

0 comments on commit b64547d

Please sign in to comment.