Skip to content

Commit b64547d

Browse files
ppalagatomjenkinson
authored andcommitted
[WFLY-7963] Require Maven 3.3.1+ and introduce mvnw
1 parent 220532e commit b64547d

14 files changed

+454
-362
lines changed

.mvn/jvm.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xmx1024M

.mvn/maven.config

Whitespace-only changes.

.mvn/wrapper/maven-wrapper.jar

48.4 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip

README.md

+19-17
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,44 @@ And of course Java EE7!
1212
Building
1313
-------------------
1414

15-
Ensure you have JDK 8 (or newer) installed
15+
Prerequisites:
1616

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

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

21-
> ./build.sh
24+
mvn install
2225

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

25-
> build.bat
29+
./mvnw install
2630

27-
If you already have Maven 3.2.5 (or newer) installed you can use it directly
31+
On Windows
2832

29-
> mvn install
33+
mvnw install
3034

3135

32-
Starting and Stopping WildFly
36+
Starting and Stopping WildFly
3337
------------------------------------------
3438
Change to the bin directory after a successful build
3539

36-
> $ cd build/target/wildfly-\[version\]/bin
40+
$ cd build/target/wildfly-\[version\]/bin
3741

3842
Start the server in domain mode
3943

40-
> $ ./domain.sh
44+
./domain.sh
4145

4246
Start the server in standalone mode
4347

44-
> $ ./standalone.sh
48+
./standalone.sh
4549

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

48-
> $ ./jboss-cli.sh --connect command=:shutdown
52+
./jboss-cli.sh --connect command=:shutdown
4953

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

@@ -76,13 +80,11 @@ The testsuite module contains several submodules including the following:
7680
* "integration" -- tests of a WildFly standalone server's internals. Should be run with no failures before any major commits.
7781
* "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.
7882

79-
To run the basic testsuite including smoke tests from the root directory, run the build script "./build.sh" or "build.bat":
80-
81-
For basic smoke tests, simply: "./build.sh test"
83+
For basic smoke tests, simply: `mvn test`
8284

8385
To run all the tests
8486

85-
> $ ./build.sh install -DallTests
87+
mvn install -DallTests
8688

8789
Using Eclipse
8890
-------------

build.bat

+19-64
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
@echo off
22
REM ======================================================================
33
REM
4-
REM This is the main entry point for the build system.
4+
REM A build script
55
REM
6-
REM Users should be sure to execute this file rather than 'mvn' to ensure
7-
REM the correct version is being used with the correct configuration.
6+
REM At present this script does nothing else than pass the arguments by to
7+
REM mvnw and you are encouraged to use mvnw (a.k.a. Maven Wrapper)
8+
REM directly.
89
REM
9-
REM ======================================================================
10+
REM Note that in the past, this script took the following responsibilities
11+
REM that are now handled by mvnw or Maven itself:
12+
REM
13+
REM * Download and install a specific version of Maven
14+
REM * Set Maven options via MAVEN_OPTS environment variable - these can
15+
REM now be set in .mvn/jvm.config and .mvn/maven.config
1016
REM
11-
REM $Id: build.bat 105735 2010-06-04 19:45:13Z pgier $
17+
REM ======================================================================
1218
REM
1319
REM Authors:
1420
REM Jason Dillon <[email protected]>
@@ -28,68 +34,17 @@ SETLOCAL
2834
set CLASSPATH=
2935
set M2_HOME=
3036
set MAVEN_HOME=
31-
set MAVEN_OPTS=%MAVEN_OPTS% -Xmx768M
32-
powershell -noprofile -executionpolicy bypass -file "tools\download-maven.ps1"
33-
34-
REM ******************************************************
35-
REM - "for" loops have been unrolled for compatibility
36-
REM with some WIN32 systems.
37-
REM ******************************************************
38-
39-
set NAMES=tools;tools\maven;tools\apache\maven
40-
set SUBFOLDERS=.;..;..\..;..\..\..;..\..\..\..
41-
42-
REM ******************************************************
43-
REM ******************************************************
44-
45-
SET EXECUTED=FALSE
46-
for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
47-
48-
goto :EOF
49-
50-
51-
REM ******************************************************
52-
REM ********* Search for names in the subfolders *********
53-
REM ******************************************************
54-
55-
:subLoop
56-
for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
5737

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

41+
set DIRNAME=%~p0
42+
set MVN=%DIRNAME%\mvn.cmd
6043

61-
REM ******************************************************
62-
REM ************ Test if Maven Batch file exists ***********
63-
REM ******************************************************
64-
65-
:testIfExists
66-
if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
67-
68-
goto :EOF
69-
70-
71-
REM ******************************************************
72-
REM ************** Batch file has been found *************
73-
REM ******************************************************
74-
75-
:BatchFound
76-
if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
77-
set EXECUTED=TRUE
78-
79-
goto :EOF
80-
81-
REM ******************************************************
82-
REM ************* Execute Batch file only once ***********
83-
REM ******************************************************
84-
85-
:ExecuteBatch
86-
set GOAL=%2
44+
set GOAL=%1
8745
if "%GOAL%"=="" set GOAL=install
8846

89-
echo Calling %1 %GOAL% %3 %4 %5 %6 %7 %8
90-
call %1 %GOAL% %3 %4 %5 %6 %7 %8
91-
92-
:end
93-
94-
if "%NOPAUSE%" == "" pause
47+
echo Calling "%MVN%" %GOAL% %2 %3 %4 %5 %6 %7
48+
call "%MVN%" %GOAL% %2 %3 %4 %5 %6 %7
9549

50+
if "%NOPAUSE%" == "" pause

build.sh

+16-66
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
#!/bin/sh -e
22
### ====================================================================== ###
33
## ##
4-
## This is the main entry point for the build system. ##
4+
## A build script ##
55
## ##
6-
## Users should execute this file rather than 'mvn' to ensure ##
7-
## the correct version is being used with the correct configuration. ##
6+
## Note that in the past, this script took the following responsibilities ##
7+
## that are now handled by ./mvnw (a.k.a. Maven Wrapper) or Maven itself: ##
8+
## ##
9+
## * Download and install a specific version of Maven ##
10+
## * Set Maven options via MAVEN_OPTS environment variable - these can ##
11+
## now be set in .mvn/jvm.config and .mvn/maven.config ##
12+
## ##
13+
## The only task left in this script is settting a sufficient limit for ##
14+
## the open files (a.k.a. ulimit -n). If this is not important to you, ##
15+
## feel free to use ./mvnw directly ##
816
## ##
917
### ====================================================================== ###
1018

11-
# $Id: build.sh 105735 2010-06-04 19:45:13Z pgier $
12-
1319
PROGNAME=`basename $0`
14-
DIRNAME=`dirname $0`
20+
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1521
GREP="grep"
1622
ROOT="/"
1723

1824
# Ignore user's MAVEN_HOME if it is set
1925
M2_HOME=""
2026
MAVEN_HOME=""
2127

22-
MAVEN_OPTS="$MAVEN_OPTS -Xmx1024M"
23-
export MAVEN_OPTS
24-
25-
./tools/download-maven.sh
26-
27-
# Default search path for maven.
28-
MAVEN_SEARCH_PATH="\
29-
tools
30-
tools/maven \
31-
tools/apache/maven \
32-
maven"
33-
34-
28+
# MAVEN_OPTS now live in .mvn/jvm.config and .mvn/maven.config
29+
# MAVEN_OPTS="$MAVEN_OPTS -Xmx1024M"
30+
# export MAVEN_OPTS
3531

3632
# Use the maximum available, or set MAX_FD != -1 to use that
3733
MAX_FD="maximum"
@@ -75,19 +71,6 @@ source_if_exists() {
7571
done
7672
}
7773

78-
find_maven() {
79-
search="$*"
80-
for d in $search; do
81-
MAVEN_HOME="${DIRNAME}/$d"
82-
MVN="$MAVEN_HOME/bin/mvn"
83-
if [ -x "$MVN" ]; then
84-
# Found.
85-
echo $MAVEN_HOME
86-
break
87-
fi
88-
done
89-
}
90-
9174
#
9275
# Main function.
9376
#
@@ -111,38 +94,7 @@ main() {
11194
fi
11295
fi
11396

114-
# Try the search path.
115-
MAVEN_HOME=`find_maven $MAVEN_SEARCH_PATH`
116-
117-
# Try looking up to root.
118-
if [ "x$MAVEN_HOME" = "x" ]; then
119-
target="build"
120-
_cwd=`pwd`
121-
122-
while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
123-
cd ..
124-
cwd=`pwd`
125-
MAVEN_HOME=`find_maven $MAVEN_SEARCH_PATH`
126-
done
127-
128-
# Make sure we get back.
129-
cd $_cwd
130-
131-
if [ "$cwd" != "$ROOT" ]; then
132-
found="true"
133-
fi
134-
135-
# Complain if we did not find anything.
136-
if [ "$found" != "true" ]; then
137-
die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
138-
fi
139-
fi
140-
141-
# Make sure we have one.
142-
MVN=$MAVEN_HOME/bin/mvn
143-
if [ ! -x "$MVN" ]; then
144-
die "Maven file is not executable: $MVN"
145-
fi
97+
MVN="$DIRNAME/mvnw"
14698

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

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

0 commit comments

Comments
 (0)