[SUREFIRE-1463] integration tests should run on the top of JDK 9

Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/e93cfd72
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/e93cfd72
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/e93cfd72

Branch: refs/heads/SUREFIRE-1463
Commit: e93cfd726c885e0db58fc8c4c8722a334c72bc46
Parents: 27a5e6a
Author: Tibor17 <tibordig...@apache.org>
Authored: Sat Jan 13 23:22:07 2018 +0100
Committer: Tibor17 <tibordig...@apache.org>
Committed: Sun Feb 4 07:12:14 2018 +0100

----------------------------------------------------------------------
 Jenkinsfile                                     | 254 +++++++++++++++++--
 README.md                                       |   4 +-
 maven-failsafe-plugin/pom.xml                   |   1 +
 .../src/it/jetty-war-test-failing/pom.xml       |  10 +-
 .../src/it/jetty-war-test-passing/pom.xml       |  10 +-
 .../src/it/multiple-summaries-failing/pom.xml   |   6 +
 .../src/it/multiple-summaries/pom.xml           |   6 +
 .../src/it/working-directory/pom.xml            |   6 +
 .../ModularClasspathForkConfigurationTest.java  |   5 +-
 pom.xml                                         |   7 +-
 surefire-booter/pom.xml                         |  13 +
 .../maven/surefire/booter/SystemUtils.java      |   4 +-
 .../maven/surefire/booter/SystemUtilsTest.java  |   7 +-
 surefire-integration-tests/pom.xml              |  50 +---
 .../maven/surefire/its/AbstractJigsawIT.java    |  23 +-
 .../maven/surefire/its/Java9FullApiIT.java      |   5 +-
 .../apache/maven/surefire/its/RunOrderIT.java   |   1 -
 .../surefire/its/fixture/SurefireLauncher.java  |  45 +++-
 ...urefire1295AttributeJvmCrashesToTestsIT.java |  19 +-
 .../resources/environment-variables/pom.xml     |  14 +-
 .../src/test/resources/fail-fast-junit/pom.xml  |   8 -
 .../src/test/resources/fail-fast-testng/pom.xml |   8 -
 .../src/test/resources/failingBuilds/pom.xml    |  10 +-
 .../src/test/resources/failsafe-notests/pom.xml |   7 +
 .../resources/failure-result-counting/pom.xml   |  10 +-
 .../src/test/resources/failureOutput/pom.xml    |  10 +-
 .../test/resources/fork-consoleOutput/pom.xml   |  10 +-
 .../fork-consoleOutputWithErrors/pom.xml        |  10 +-
 .../src/test/resources/fork-fail/pom.xml        |  14 +-
 .../resources/fork-mode-multimodule/pom.xml     |  13 +-
 .../fork-mode-resource-loading/pom.xml          |  12 +-
 .../src/test/resources/fork-mode-testng/pom.xml |  12 +-
 .../src/test/resources/fork-mode/pom.xml        |  12 +-
 .../src/test/resources/fork-timeout/pom.xml     |   7 +-
 .../includes-excludes-from-file/pom.xml         |   2 +
 .../test/resources/includes-excludes/pom.xml    |   4 +-
 .../test/resources/isolated-classloader/pom.xml |   4 +
 .../src/test/resources/java9-full-api/pom.xml   |   5 -
 .../resources/junit-fork-mode-always/pom.xml    |  15 +-
 .../src/test/resources/junit-ignore/pom.xml     |  10 +-
 .../src/test/resources/junit-innerClass/pom.xml |   5 +
 .../junit-notExtendingTestCase/pom.xml          |   5 +
 .../test/resources/junit-pathWithUmlaut/pom.xml |   5 +
 .../resources/junit-twoTestCaseSuite/pom.xml    |   5 +
 .../test/resources/junit-twoTestCases/pom.xml   |   5 +
 .../junit4-forkAlways-staticInit/pom.xml        |  13 +-
 .../junit4-rerun-failing-tests/pom.xml          |  13 +-
 .../test/resources/junit4-runlistener/pom.xml   |  10 +-
 .../resources/junit4-twoTestCaseSuite/pom.xml   |  10 +-
 .../src/test/resources/junit4/pom.xml           |  12 +-
 .../src/test/resources/junit44-dep/pom.xml      |  14 +-
 .../test/resources/junit44-environment/pom.xml  |  13 +-
 .../src/test/resources/junit44-hamcrest/pom.xml |  14 +-
 .../resources/junit44-method-pattern/pom.xml    |  10 +-
 .../resources/junit44-multiple-methods/pom.xml  |   8 -
 .../resources/junit44-single-method/pom.xml     |  10 +-
 .../test/resources/junit47-parallel-nts/pom.xml |   7 -
 .../junit47-parallel-with-suite/pom.xml         |  10 +-
 .../src/test/resources/junit47-parallel/pom.xml |   7 -
 .../resources/junit47-redirect-output/pom.xml   |  10 +-
 .../junit47-static-inner-class-tests/pom.xml    |  12 +-
 .../test/resources/junit48-categories/pom.xml   |  10 +-
 .../resources/junit48-method-pattern/pom.xml    |   8 -
 .../junit48-multiple-method-patterns/pom.xml    |   8 -
 .../resources/junit48-multiple-methods/pom.xml  |   8 -
 .../resources/junit48-single-method/pom.xml     |   8 -
 .../resources/junit48-smartStackTrace/pom.xml   |  10 +-
 .../src/test/resources/norunnableTests/pom.xml  |   5 +
 .../src/test/resources/parallel-runtime/pom.xml |  12 +-
 .../resources/plain-old-java-classpath/pom.xml  |   5 +
 .../src/test/resources/plexus-conflict/pom.xml  |   5 +
 .../src/test/resources/pojo-simple/pom.xml      |  13 +-
 .../src/test/resources/pom.xml                  |  10 +-
 .../src/test/resources/reporters/pom.xml        |  10 +-
 .../src/test/resources/result-counting/pom.xml  |  10 +-
 .../src/test/resources/runOrder/pom.xml         |   5 +
 .../test/resources/runorder-parallel/pom.xml    |  13 +-
 .../sibling-aggregator/aggregator/pom.xml       |   6 +
 .../resources/sibling-aggregator/child1/pom.xml |   5 +
 .../resources/sibling-aggregator/child2/pom.xml |   5 +
 .../resources/small-result-counting/pom.xml     |  10 +-
 .../jiras-surefire-1024-testjar/pom.xml         |  17 +-
 .../pom.xml                                     |  14 -
 .../pom.xml                                     |   7 -
 .../surefire-1053-system-properties/pom.xml     |   7 -
 .../surefire-1055-parallelTestCount/pom.xml     |   8 -
 .../pom.xml                                     |  13 +-
 .../pom.xml                                     |  13 +-
 .../surefire-1095-npe-in-runlistener/pom.xml    |   7 -
 .../surefire-1098-balanced-runorder/pom.xml     |   7 -
 .../pom.xml                                     |  13 +-
 .../pom.xml                                     |  13 +-
 .../pom.xml                                     |   8 -
 .../resources/surefire-1144-xml-runtime/pom.xml |  13 -
 .../pom.xml                                     |   7 -
 .../pom.xml                                     |   8 -
 .../pom.xml                                     |   7 -
 .../surefire-1158-remove-info-lines/pom.xml     |   8 -
 .../pom.xml                                     |   8 -
 .../src/test/resources/surefire-1185/pom.xml    |   7 -
 .../surefire-1202-rerun-and-failfast/pom.xml    |  15 +-
 .../surefire-1209-rerun-and-forkcount/pom.xml   |  15 +-
 .../src/test/resources/surefire-1211/pom.xml    |   8 -
 .../surefire-1278-group-name-ending/pom.xml     |  13 +-
 .../src/test/resources/surefire-1364/pom.xml    |   3 +-
 .../src/test/resources/surefire-1367/pom.xml    |   2 -
 .../pom.xml                                     |   5 +
 .../pom.xml                                     |   5 +
 .../pom.xml                                     |  16 +-
 .../surefire-141-pluggableproviders/pom.xml     |  12 +-
 .../surefire-146-forkPerTestNoSetup/pom.xml     |   5 +
 .../surefire-162-charsetProvider/pom.xml        |  11 +-
 .../surefire-224-wellFormedXmlFailures/pom.xml  |   5 +
 .../surefire-257-rerunningTests/pom.xml         |   5 +
 .../surefire-260-testWithIdenticalNames/pom.xml |   5 +
 .../surefire-34-securityManager-success/pom.xml |  11 +-
 .../surefire-34-securityManager/pom.xml         |  11 +-
 .../pom.xml                                     |   5 +
 .../surefire-500-puzzling-error/pom.xml         |  15 +-
 .../surefire-510-testClassPath/pom.xml          |  12 +-
 .../pom.xml                                     |   5 +
 .../surefire-613-testCount-in-parallel/pom.xml  |  12 +-
 .../pom.xml                                     |  12 +-
 .../pom.xml                                     |  10 +-
 .../pom.xml                                     |  11 +-
 .../surefire-649-systemProperties/pom.xml       |   7 -
 .../pom.xml                                     |   7 -
 .../test/resources/surefire-673-mockito/pom.xml |  13 +-
 .../surefire-674-buildFailingWhenErrors/pom.xml |  10 +-
 .../surefire-685-commaseparatedIncludes/pom.xml |   5 +
 .../resources/surefire-697-niceSummary/pom.xml  |   5 +
 .../surefire-733-allOverridesCaptured/pom.xml   |   2 +
 .../pom.xml                                     |   7 +-
 .../pom.xml                                     |   7 +-
 .../surefire-806-specifiedTests-multi/pom.xml   |   5 +
 .../surefire-806-specifiedTests-single/pom.xml  |   5 +
 .../surefire-809-groupExpr-junit48/pom.xml      |  10 +-
 .../surefire-809-groupExpr-testng/pom.xml       |  11 +-
 .../surefire-812-log4j-classloader/pom.xml      |  13 +-
 .../resources/surefire-817-system-exit/pom.xml  |   7 -
 .../surefire-818-ignored-tests-on-npe/pom.xml   |  10 +-
 .../surefire-828-emptyGroupExpr-junit48/pom.xml |  10 +-
 .../surefire-828-emptyGroupExpr-testng/pom.xml  |  15 +-
 .../surefire-832-provider-selection/pom.xml     |  10 +-
 .../resources/surefire-847-testngfail/pom.xml   |  11 +-
 .../surefire-855-failsafe-use-bundle/pom.xml    |  10 +-
 .../surefire-855-failsafe-use-jar/pom.xml       |  10 +-
 .../surefire-855-failsafe-use-war/pom.xml       |  10 +-
 .../surefire-930-failsafe-runtests/pom.xml      |   7 +-
 .../surefire-931-provider-failure/pom.xml       |  11 +-
 .../surefire-943-report-content/pom.xml         |   7 +-
 .../pom.xml                                     |  13 +-
 .../surefire-946-self-destruct-plugin/pom.xml   |   7 +-
 .../surefire-972-bizarre-noclassdef/pom.xml     |   4 +
 .../surefire-975-wrong-encoding/pom.xml         |   7 +-
 .../module1/pom.xml                             |  10 +-
 .../module2/pom.xml                             |  10 +-
 .../pom.xml                                     |  10 +-
 .../pom.xml                                     |   8 -
 .../surefire-995-categoryInheritance/pom.xml    |   7 -
 .../test/resources/system-properties/pom.xml    |   2 +
 .../test-helper-dump-pid-plugin/pom.xml         |   7 +-
 .../resources/testng-afterSuiteFailure/pom.xml  |  15 +-
 .../test/resources/testng-beforeMethod/pom.xml  |  16 +-
 .../testng-beforeMethodFailure/pom.xml          |  15 +-
 .../test/resources/testng-execute-error/pom.xml |  12 +-
 .../testng-group-thread-parallel/pom.xml        |   8 -
 .../src/test/resources/testng-groups/pom.xml    |  13 +-
 .../src/test/resources/testng-jdk14/pom.xml     |   5 +
 .../resources/testng-junit-together/pom.xml     |  14 +-
 .../resources/testng-junit4-together/pom.xml    |  13 -
 .../resources/testng-listener-reporter/pom.xml  |  14 +-
 .../testng-method-pattern-after/pom.xml         |  17 +-
 .../testng-method-pattern-before/pom.xml        |  17 +-
 .../resources/testng-method-pattern/pom.xml     |  14 +-
 .../testng-multiple-method-patterns/pom.xml     |   8 -
 .../test/resources/testng-objectFactory/pom.xml |   8 -
 .../resources/testng-parallel-suites/pom.xml    |   8 -
 .../testng-parallel-with-annotations/pom.xml    |  12 +-
 .../resources/testng-path with spaces/pom.xml   |  16 +-
 .../src/test/resources/testng-simple/pom.xml    |  13 +-
 .../testng-single-method-5-14-9/pom.xml         |  14 +-
 .../test/resources/testng-single-method/pom.xml |  14 +-
 .../src/test/resources/testng-suite-xml/pom.xml |  13 +-
 .../resources/testng-testRunnerFactory/pom.xml  |   8 -
 .../resources/testng-twoTestCaseSuite/pom.xml   |  14 +-
 .../src/test/resources/timeout-forked/pom.xml   |   5 +
 .../test/resources/unicode-testnames/pom.xml    |   7 +-
 .../pom.xml                                     |   7 +
 .../resources/working-directory-missing/pom.xml |   4 +
 .../test/resources/working-directory/pom.xml    |   6 +
 191 files changed, 873 insertions(+), 1218 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/Jenkinsfile
----------------------------------------------------------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 9863659..58551d1 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,31 +1,243 @@
-pipeline {
-    agent none
-    stages {
-        stage('Parallel Unix and Windows Build') {
-            steps {
-                parallel unix: {
-                    node("${env.NIX_LABEL}") {
-                        checkout scm
-                        withEnv(["JAVA_HOME=${tool('JDK 1.8.0_144')}", 
"PATH+MAVEN=${tool('Maven 3.5.0')}/bin:${env.JAVA_HOME}/bin"]) {
-                            sh "mvn clean install jacoco:report -B -U -e -fae 
-V -P run-its,jenkins -Dsurefire.useFile=false -Dfailsafe.useFile=false 
-Dintegration-test-port=8084   \\\"-Djdk.home=${tool('JDK 9 b181')}\\\""
+#!/usr/bin/env groovy
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '0', daysToKeepStr: env.BRANCH_NAME == 'master' ? '30' : 
'7', numToKeepStr: '5'))])
+
+def oses = ['windows']//['linux', 'windows']
+def mavens = env.BRANCH_NAME == 'master' ? ['3.2.x', '3.3.x', '3.5.x'] : 
['3.5.x']
+def jdks = env.BRANCH_NAME == 'master' ? ['7', '8', '9', '10'] : ['10']
+
+def cmd = ['mvn']
+def options = ['-e', '-V']
+def optionsITs = ['-e', '-V', '-P', 'run-its', '-nsu']
+def goals = ['clean', 'install' , 'jacoco:report']
+def goalsITs = ['verify']
+def Map stages = [:]
+
+oses.eachWithIndex { os, indexOfOs ->
+
+    mavens.eachWithIndex { maven, indexOfMaven ->
+
+        jdks.eachWithIndex { jdk, indexOfJdk ->
+
+            def String label = jenkinsEnv.labelForOS(os);
+            def String jdkTestName = jenkinsEnv.jdkFromVersion(os, jdk)
+            def String jdkName = jenkinsEnv.jdkFromVersion(os, '8')
+            def String mvnName = jenkinsEnv.mvnFromVersion(os, maven)
+
+            def stageKey = "${os}-jdk${jdk}-maven${maven}"
+
+            if (label == null || jdkTestName == null || mvnName == null) {
+                println "Skipping ${stageKey} as unsupported by Jenkins 
Environment."
+                return;
+            }
+
+            println "${stageKey}  ==>  Label: ${label}, JDK: ${jdkTestName}, 
Maven: ${mvnName}."
+
+
+            stages[stageKey] = {
+                if (os == 'windows') {
+                    node("${env.WIN_LABEL}") {
+                        try {
+                            println "Basedir = ${pwd()}."
+
+                            def mvnLocalRepoDir
+
+                            dir('.repository') {
+                                mvnLocalRepoDir = "${pwd()}"
+                            }
+
+                            println "Maven Local Repository = 
${mvnLocalRepoDir}."
+
+                            dir('build') {
+                                stage("checkout ${stageKey}") {
+                                    checkout scm
+                                }
+
+                                stage("build ${stageKey}") {
+                                    def jdkTestHome = 
resolveToolNameToJavaPath(jdkTestName, mvnName)
+                                    println("Setting JDK for testing 
-Djdk.home=${jdkTestHome}")
+
+                                    def properties = 
["\"-Djdk.home=${jdkTestHome}\"", "-Djacoco.skip=true"]
+
+                                    withMaven(jdk: jdkName, maven: mvnName,
+                                        mavenLocalRepo: mvnLocalRepoDir, 
mavenOpts: '-Xmx512m') {
+                                        def script = cmd + options + goals // 
+ properties
+                                        bat script.join(' ')
+                                    }
+                                }
+
+                                stage("build-failsafe-it ${stageKey}") {
+//                                    lock('maven-surefire-its') {
+//                                        timeout(time: 15, unit: 'MINUTES') {
+//                                            withMaven(jdk: jdkName, maven: 
mvnName,
+//                                                mavenLocalRepo: 
mvnLocalRepoDir, mavenOpts: '-Xmx512m',
+//                                                options: 
[invokerPublisher()]) {
+//                                                def script = cmd + 
optionsITs + goalsITs + propertiesITs
+//                                                bat script.join(' ')
+//                                            }
+//                                        }
+//                                    }
+                                }
+                            }
+                        } finally {
+//                            zip(zipFile: 
"it--maven-failsafe-plugin--${stageKey}.zip", dir: 
'build/maven-failsafe-plugin/target/it', archive: true)
+//                            zip(zipFile: 
"it--surefire-integration-tests--${stageKey}.zip", dir: 
'build/surefire-integration-tests/target', archive: true)
+
+                            stage("cleanup ${stageKey}") {
+                                // clean up after ourselves to reduce disk 
space
+                                cleanWs()
+                            }
                         }
-                        jacoco changeBuildStatus: false, execPattern: 
'**/*.exec', sourcePattern: '**/src/main/java', exclusionPattern: 
'pkg/*.class,plexusConflict/*.class,**/surefire570/**/*.class,siblingAggregator/*.class,surefire257/*.class,surefire979/*.class,org/apache/maven/surefire/crb/*.class,org/apache/maven/plugins/surefire/selfdestruct/*.class,org/apache/maven/plugins/surefire/dumppid/*.class,org/apache/maven/plugin/surefire/*.class,org/apache/maven/plugin/failsafe/*.class,jiras/**/*.class,org/apache/maven/surefire/testng/*.class,org/apache/maven/surefire/testprovider/*.class,**/test/*.class,**/org/apache/maven/surefire/group/parse/*.class'
-                        junit healthScaleFactor: 0.0, allowEmptyResults: true, 
keepLongStdio: true, testResults: 
'**/surefire-integration-tests/target/failsafe-reports/**/*.xml,**/surefire-integration-tests/target/surefire-reports/**/*.xml,**/maven-*/target/surefire-reports/**/*.xml,**/surefire-*/target/surefire-reports/**/*.xml,**/common-*/target/surefire-reports/**/*.xml'
                     }
-                },
-                windows: {
-                    node("${env.WIN_LABEL}") {
-                        checkout scm
-                        withEnv(["JAVA_HOME=${tool('JDK 1.8_121 (Windows 
Only)')}", "PATH+MAVEN=${tool('Maven 3.5.0 
(Windows)')}\\bin;${env.JAVA_HOME}\\bin"]) {
-                            bat "mvn clean install jacoco:report -B -U -e -fae 
-V -P run-its,jenkins -Dsurefire.useFile=false -Dfailsafe.useFile=false 
-Dintegration-test-port=8084"
+                } else {
+                    node("${env.NIX_LABEL}") {
+                        try {
+                            println "Basedir = ${pwd()}."
+
+                            def mvnLocalRepoDir
+
+                            dir('.repository') {
+                                mvnLocalRepoDir = "${pwd()}"
+                            }
+
+                            println "Maven Local Repository = 
${mvnLocalRepoDir}."
+
+                            dir('build') {
+                                stage("checkout ${stageKey}") {
+                                    checkout scm
+                                }
+
+                                stage("build ${stageKey}") {
+                                    def jdkTestHome = 
resolveToolNameToJavaPath(jdkTestName, mvnName)
+                                    println("Setting JDK for testing 
-Djdk.home=${jdkTestHome}")
+
+                                    
//https://github.com/jacoco/jacoco/issues/629
+                                    def skipJacoco = jdk == '9' ? 'false' : 
'true'
+                                    def propertiesJdk = 
"\"-Djdk.home=${jdkTestHome}\""
+                                    def properties = [propertiesJdk, 
"-Djacoco.skip=${skipJacoco}"]
+                                    def propertiesITs = [propertiesJdk, 
'-Djacoco.skip=true']
+
+                                    withMaven(jdk: jdkName, maven: mvnName,
+                                        mavenLocalRepo: mvnLocalRepoDir, 
mavenOpts: '-Xmx1g') {
+                                        def script = cmd + options + goals + 
properties
+                                        sh script.join(' ')
+                                    }
+                                }
+
+                                stage("build-failsafe-it ${stageKey}") {
+//                                    lock('maven-surefire-its') {
+//                                        timeout(time: 15, unit: 'MINUTES') {
+//                                            withMaven(jdk: jdkName, maven: 
mvnName,
+//                                                mavenLocalRepo: 
mvnLocalRepoDir, mavenOpts: '-Xmx1g',
+//                                                options: 
[invokerPublisher()]) {
+//                                                def script = cmd + 
optionsITs + goalsITs + propertiesITs
+//                                                sh script.join(' ')
+//                                            }
+//                                        }
+//                                    }
+                                }
+                            }
+                        } finally {
+                            if (indexOfMaven == mavens.size() - 1 && jdk == 
'9') {
+                                jacoco changeBuildStatus: false, execPattern: 
'**/*.exec', sourcePattern: '**/src/main/java', exclusionPattern: 
'pkg/*.class,plexusConflict/*.class,**/surefire570/**/*.class,siblingAggregator/*.class,surefire257/*.class,surefire979/*.class,org/apache/maven/surefire/crb/*.class,org/apache/maven/plugins/surefire/selfdestruct/*.class,org/apache/maven/plugins/surefire/dumppid/*.class,org/apache/maven/plugin/surefire/*.class,org/apache/maven/plugin/failsafe/*.class,jiras/**/*.class,org/apache/maven/surefire/testng/*.class,org/apache/maven/surefire/testprovider/*.class,**/test/*.class,**/org/apache/maven/surefire/group/parse/*.class'
+                                junit healthScaleFactor: 0.0, 
allowEmptyResults: true, keepLongStdio: true, testResults: 
'**/surefire-integration-tests/target/failsafe-reports/**/*.xml,**/surefire-integration-tests/target/surefire-reports/**/*.xml,**/maven-*/target/surefire-reports/**/*.xml,**/surefire-*/target/surefire-reports/**/*.xml,**/common-*/target/surefire-reports/**/*.xml'
+                                if (currentBuild.result == 'UNSTABLE') 
currentBuild.result = 'FAILURE'
+                            }
+
+//                            zip(zipFile: 
"it--maven-failsafe-plugin--${stageKey}.zip", dir: 
'build/maven-failsafe-plugin/target/it', archive: true)
+//                            zip(zipFile: 
"it--surefire-integration-tests--${stageKey}.zip", dir: 
'build/surefire-integration-tests/target', archive: true)
+//
+//                            sh 'tar czvf it1.tgz 
build/maven-failsafe-plugin/target/it'
+//                            sh 'tar czvf it2.tgz 
build/surefire-integration-tests/target'
+//                            archiveArtifacts(artifacts: '**/*.tgz', 
allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false)
+//                            archiveArtifacts(artifacts: '*.tgz', 
allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false)
+
+                            stage("cleanup ${stageKey}") {
+                                // clean up after ourselves to reduce disk 
space
+                                cleanWs()
+                            }
                         }
                     }
                 }
             }
         }
     }
-    options {
-        buildDiscarder(logRotator(numToKeepStr:'10'))
-        timeout(time: 10, unit: 'HOURS')
+}
+
+timeout(time: 18, unit: 'HOURS') {
+    try {
+        parallel(stages)
+        // JENKINS-34376 seems to make it hard to detect the aborted builds
+    } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
+        // this ambiguous condition means a user probably aborted
+        if (e.causes.size() == 0) {
+            currentBuild.result = "ABORTED"
+        } else {
+            currentBuild.result = "FAILURE"
+        }
+        throw e
+    } catch (hudson.AbortException e) {
+        // this ambiguous condition means during a shell step, user probably 
aborted
+        if (e.getMessage().contains('script returned exit code 143')) {
+            currentBuild.result = "ABORTED"
+        } else {
+            currentBuild.result = "FAILURE"
+        }
+        throw e
+    } catch (InterruptedException e) {
+        currentBuild.result = "ABORTED"
+        throw e
+    } catch (Throwable e) {
+        currentBuild.result = "FAILURE"
+        throw e
+    } finally {
+        stage("notifications") {
+            //jenkinsNotify()
+        }
+    }
+}
+
+/**
+ * It is used instead of tool(${jdkTestName}).
+ */
+def resolveToolNameToJavaPath(jdkToolName, mvnName) {
+    def javaHome = null
+    try {
+        withMaven(jdk: jdkToolName, maven: mvnName) {
+            javaHome = isUnix() ? sh(script: 'echo -en $JAVA_HOME', 
returnStdout: true) : bat(script: '@echo %JAVA_HOME%', returnStdout: true)
+        }
+
+        if (javaHome != null) {
+            javaHome = javaHome.trim()
+            def exec = javaHome + (isUnix() ? '/bin/java' : '\\bin\\java.exe')
+            if (!fileExists(exec)) {
+                println "The ${exec} does not exist in 
jdkToolName=${jdkToolName}."
+                javaHome = null
+            }
+        }
+    } catch(e) {
+        println "Caught an exception while resolving 'jdkToolName' 
${jdkToolName} via 'mvnName' ${mvnName}: ${e}"
+        javaHome = null;
     }
+    assert javaHome != null : "Could not resolve ${jdkToolName} to JAVA_HOME."
+    return javaHome
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 2361f5d..c3dd2d2 100644
--- a/README.md
+++ b/README.md
@@ -31,8 +31,8 @@ In order to build Surefire project use **Maven 3.1.0+** and 
**JDK 1.8**.
 But in order to run IT tests, you can do:   
 
 * In order to run tests for a release check during the vote the following 
memory requirements are needed:   
-  **(on Linux/Unix)** *export MAVEN_OPTS="-Xmx768m -XX:MaxMetaspaceSize=864m 
-XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true"*  
-  **(on Windows)** *set MAVEN_OPTS="-Xmx768m -XX:MaxMetaspaceSize=864m 
-XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true"*    
+  **(on Linux/Unix)** *export MAVEN_OPTS="-server -Xmx512m 
-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:+UseG1GC 
-XX:+UseStringDeduplication -XX:+TieredCompilation -XX:TieredStopAtLevel=1 
-XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true 
-Dhttps.protocols=TLSv1"*  
+  **(on Windows)** *set MAVEN_OPTS="-server -Xmx256m -XX:MetaspaceSize=128m 
-XX:MaxMetaspaceSize=384m -XX:+UseG1GC -XX:+UseStringDeduplication 
-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 
-Djava.awt.headless=true -Dhttps.protocols=TLSv1"*    
 * In order to run the build with **JDK 9** **on Windows** (**on Linux/Unix 
modify system property jdk.home**):  
   *mvn install site site:stage -P reporting,run-its "-Djdk.home=e:\Program 
Files\Java\jdk9\"* 
   

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-failsafe-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index ace3231..9e3d87b 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -300,6 +300,7 @@
               </execution>
             </executions>
             <configuration>
+              <javaHome>${jdk.home}</javaHome>
               
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
             </configuration>
           </plugin>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml 
b/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml
index cc65b18..193791d 100644
--- a/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml
+++ b/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml
@@ -118,14 +118,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.0.2</version>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 
@@ -135,6 +127,8 @@
     <integration-test-port>8083</integration-test-port>
     <integration-test-stop-port>18009</integration-test-stop-port>
     <jetty-version>9.2.2.v20140723</jetty-version>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml 
b/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml
index b90d3d8..31dc8ec 100644
--- a/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml
+++ b/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml
@@ -118,14 +118,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.0.2</version>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 
@@ -135,6 +127,8 @@
     <integration-test-port>8083</integration-test-port>
     <integration-test-stop-port>18009</integration-test-stop-port>
     <jetty-version>9.2.2.v20140723</jetty-version>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml 
b/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
index 41e36d5..aedbdde 100644
--- a/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
+++ b/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
@@ -25,6 +25,12 @@
   <artifactId>working-directory-test</artifactId>
   <version>1.0</version>
   <name>Run tests multiple times</name>
+
+  <properties>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml 
b/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
index 921af08..d87409f 100644
--- a/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
+++ b/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
@@ -25,6 +25,12 @@
   <artifactId>working-directory-test</artifactId>
   <version>1.0</version>
   <name>Run tests multiple times</name>
+
+  <properties>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-failsafe-plugin/src/it/working-directory/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/working-directory/pom.xml 
b/maven-failsafe-plugin/src/it/working-directory/pom.xml
index c250b69..6cf2bc5 100644
--- a/maven-failsafe-plugin/src/it/working-directory/pom.xml
+++ b/maven-failsafe-plugin/src/it/working-directory/pom.xml
@@ -25,6 +25,12 @@
   <artifactId>working-directory-test</artifactId>
   <version>1.0</version>
   <name>Run tests in a nonexistent working directory</name>
+
+  <properties>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
----------------------------------------------------------------------
diff --git 
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
 
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
index ce384fe..6053f24 100644
--- 
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
+++ 
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
@@ -39,6 +39,7 @@ import java.util.Properties;
 
 import static java.io.File.separator;
 import static java.io.File.pathSeparator;
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.nio.file.Files.readAllLines;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singleton;
@@ -84,7 +85,7 @@ public class ModularClasspathForkConfigurationTest
                 config.createArgsFile( descriptor, modulePath, classPath, 
packages, patchFile, startClassName );
 
         assertThat( jigsawArgsFile ).isNotNull();
-        List<String> argsFileLines = readAllLines( jigsawArgsFile.toPath() );
+        List<String> argsFileLines = readAllLines( jigsawArgsFile.toPath(), 
UTF_8 );
         assertThat( argsFileLines ).hasSize( 13 );
         assertThat( argsFileLines.get( 0 ) ).isEqualTo( "--module-path" );
         assertThat( argsFileLines.get( 1 ) ).isEqualTo( "modular.jar" + 
pathSeparator + "target/classes" );
@@ -118,7 +119,7 @@ public class ModularClasspathForkConfigurationTest
         assertThat( cli.getArguments()[0] ).startsWith( "@" );
         File argFile = new File( cli.getArguments()[0].substring( 1 ) );
         assertThat( argFile ).isFile();
-        List<String> argsFileLines2 = readAllLines( argFile.toPath() );
+        List<String> argsFileLines2 = readAllLines( argFile.toPath(), UTF_8 );
         assertThat( argsFileLines2 ).hasSize( 13 );
         for ( int i = 0; i < argsFileLines2.size(); i++ )
         {

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3592b31..8a9a405 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,8 +97,8 @@
     <maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
     <!-- Override with Jigsaw JRE 9 -->
     <jdk.home>${java.home}/..</jdk.home>
-    <maven.compiler.testSource>1.8</maven.compiler.testSource>
-    <maven.compiler.testTarget>1.8</maven.compiler.testTarget>
+    <maven.compiler.testSource>1.7</maven.compiler.testSource>
+    <maven.compiler.testTarget>1.7</maven.compiler.testTarget>
   </properties>
 
   <dependencyManagement>
@@ -263,7 +263,7 @@
       <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
-        <version>2.10.0</version>
+        <version>2.13.0</version>
         <exclusions>
           <exclusion>
             <groupId>org.hamcrest</groupId>
@@ -434,6 +434,7 @@
             <!-- NOTE: Be sure to isolate the Surefire version under test from 
the version running the tests! -->
             <useSystemClassLoader>false</useSystemClassLoader>
             <argLine>-Xms128m -Xmx144m ${jacoco.agent}</argLine>
+            <useFile>false</useFile>
           </configuration>
         </plugin>
         <plugin>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-booter/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
index 0d7f431..ef5e26c 100644
--- a/surefire-booter/pom.xml
+++ b/surefire-booter/pom.xml
@@ -108,6 +108,12 @@
             <artifactId>surefire-shadefire</artifactId>
             <version>2.12.4</version> <!-- ${shadedVersion}, but resolved due 
to https://issues.apache.org/jira/browse/MRELEASE-799 -->
           </dependency>
+          <dependency>
+            <!-- todo remove in version 3.0. Hack only forces to download it 
into an empty local repo. -->
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.7</version>
+          </dependency>
         </dependencies>
         <configuration>
           <jvm>${jdk.home}/bin/java</jvm>
@@ -115,6 +121,13 @@
           <includes>
             <include>**/JUnit4SuiteTest.java</include>
           </includes>
+          <!--todo in version 3.0 remove old commons-lang3 and use 3.7+ -->
+          <classpathDependencyExcludes>
+            
<classpathDependencyExclude>org.apache.commons:commons-lang3</classpathDependencyExclude>
+          </classpathDependencyExcludes>
+          <additionalClasspathElements>
+            
<additionalClasspathElement>${maven.repo.local}/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar</additionalClasspathElement>
+          </additionalClasspathElements>
         </configuration>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
----------------------------------------------------------------------
diff --git 
a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
 
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
index 0a68a80..9cb0ef9 100644
--- 
a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
+++ 
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
@@ -55,9 +55,9 @@ public final class SystemUtils
 {
     public static final BigDecimal JAVA_SPECIFICATION_VERSION = 
getJavaSpecificationVersion();
 
-    private static final BigDecimal JAVA_VERSION_7 = new BigDecimal( "1.7" );
+    private static final BigDecimal JAVA_VERSION_7 = new BigDecimal( "1.7" 
).stripTrailingZeros();
 
-    private static final BigDecimal JIGSAW_JAVA_VERSION = new BigDecimal( 9 );
+    private static final BigDecimal JIGSAW_JAVA_VERSION = new BigDecimal( 9 
).stripTrailingZeros();
 
     private static final int PROC_STATUS_PID_FIRST_CHARS = 20;
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
----------------------------------------------------------------------
diff --git 
a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
 
b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
index d1ba04f..5120cb5 100644
--- 
a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
+++ 
b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
@@ -63,7 +63,7 @@ public class SystemUtilsTest
         public void shouldMatchJavaSpecVersion() throws Exception
         {
             BigDecimal actual = invokeMethod( SystemUtils.class, 
"getJavaSpecificationVersion" );
-            BigDecimal expected = new BigDecimal( System.getProperty( 
"java.specification.version" ) );
+            BigDecimal expected = new BigDecimal( System.getProperty( 
"java.specification.version" ) ).stripTrailingZeros();
             assertThat( actual ).isEqualTo( expected );
             assertThat( SystemUtils.JAVA_SPECIFICATION_VERSION ).isEqualTo( 
expected );
         }
@@ -84,7 +84,7 @@ public class SystemUtilsTest
         }
 
         @Test
-        public void incorrectJdkPath() throws IOException
+        public void incorrectJdkPath()
         {
             File jre = new File( System.getProperty( "java.home" ) );
             File jdk = jre.getParentFile();
@@ -285,6 +285,7 @@ public class SystemUtilsTest
                     .isEqualTo( expectedPid );
         }
 
+        @SuppressWarnings( "unused" )
         public static ClassLoader getPlatformClassLoader()
         {
             return ClassLoader.getSystemClassLoader();
@@ -313,7 +314,7 @@ public class SystemUtilsTest
             }
         }
 
-        private static void testIsJava9AtLeast( File pathInJdk ) throws 
IOException
+        private static void testIsJava9AtLeast( File pathInJdk )
         {
             File path = new File( pathInJdk, "bin" + separator + "java" );
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/pom.xml 
b/surefire-integration-tests/pom.xml
index c1a6c4a..15ebd45 100644
--- a/surefire-integration-tests/pom.xml
+++ b/surefire-integration-tests/pom.xml
@@ -34,9 +34,6 @@
 
   <properties>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <it.settings.showPasswords>false</it.settings.showPasswords>
-    <surefire.threadcount>5</surefire.threadcount>
-    <useInterpolatedSettings>false</useInterpolatedSettings>
     <maven.compiler.source>1.7</maven.compiler.source>
     <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
@@ -76,8 +73,10 @@
       <artifactId>commons-io</artifactId>
     </dependency>
     <dependency>
+      <!-- Java 9 requires version 3.6+ (todo use in parent POM. Note: 
versions 3.6, 3.7 are compiled with Java 7) -->
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
+      <version>3.7</version>
     </dependency>
   </dependencies>
 
@@ -93,13 +92,14 @@
         <artifactId>maven-failsafe-plugin</artifactId>
         <version>2.12.4</version> <!-- ${shadedVersion}, but resolved due to 
https://issues.apache.org/jira/browse/MRELEASE-799 -->
         <configuration>
+          <jvm>${jdk.home}/bin/java</jvm>
           <runOrder>alphabetical</runOrder>
           <threadCount>1</threadCount>
           <perCoreThreadCount>false</perCoreThreadCount>
-          <forkMode>never</forkMode>
-          <argLine>${argLine}</argLine>
+          <forkMode>once</forkMode>
+          <argLine>-server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation 
-XX:TieredStopAtLevel=1 -Djava.awt.headless=true</argLine>
           <includes>
-            <include>org/apache/**/*IT*.java</include>
+            <include>org/apache/**/AbstractTestCaseIT.java</include>
           </includes>
           <!-- Pass current surefire version to the main suite so that it -->
           <!-- can forward to all integration test projects. SUREFIRE-513 -->
@@ -113,13 +113,14 @@
             
<maven.repo.local>${project.basedir}/../surefire-setup-integration-tests/target/it-repo</maven.repo.local>
             <maven.test.tmpdir>${project.build.directory}</maven.test.tmpdir>
             
<user.localRepository>${settings.localRepository}</user.localRepository>
-            
<useInterpolatedSettings>${useInterpolatedSettings}</useInterpolatedSettings>
+            <useInterpolatedSettings>false</useInterpolatedSettings>
             
<testBuildDirectory>${project.build.testOutputDirectory}</testBuildDirectory>
-            <verifier.forkMode>${verifier.forkMode}</verifier.forkMode>
+            <verifier.forkMode>forked</verifier.forkMode>
             <jdk.home>${jdk.home}</jdk.home>
             <jacoco.agent>${jacoco-it.agent}</jacoco.agent>
           </systemPropertyVariables>
           <redirectTestOutputToFile>false</redirectTestOutputToFile>
+          <useFile>false</useFile>
         </configuration>
         <dependencies>
           <dependency>
@@ -198,37 +199,4 @@
       </plugin>
     </plugins>
   </build>
-
-  <profiles>
-    <profile>
-      <id>parallel</id>
-      <properties>
-        <useInterpolatedSettings>false</useInterpolatedSettings>
-      </properties>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-failsafe-plugin</artifactId>
-            <configuration>
-              <parallel>classes</parallel>
-              <threadCount>${surefire.threadcount}</threadCount>
-              <argLine>${argLine} -Xmx512m -XX:MaxPermSize=356m</argLine>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    <profile>
-      <id>embedded</id>
-      <activation>
-        <file>
-          <!--  This employs that the basedir expression is only recognized by 
Maven 3.x (see MNG-2363) -->
-          <exists>${basedir}</exists>
-        </file>
-      </activation>
-      <properties>
-        <verifier.forkMode>auto</verifier.forkMode>
-      </properties>
-    </profile>
-  </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
index 5063a2d..7f73d48 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
@@ -29,6 +29,8 @@ import java.io.InputStream;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
+import static 
org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME;
+import static 
org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeTrue;
 
@@ -41,8 +43,6 @@ import static org.junit.Assume.assumeTrue;
 public abstract class AbstractJigsawIT
         extends SurefireJUnit4IntegrationTestCase
 {
-    protected static final String JDK_HOME_KEY = "jdk.home";
-    protected static final String JDK_HOME = System.getProperty( JDK_HOME_KEY 
);
     private static final double JIGSAW_JAVA_VERSION = 9.0d;
 
     protected abstract String getProjectDirectoryName();
@@ -50,22 +50,17 @@ public abstract class AbstractJigsawIT
     protected SurefireLauncher assumeJigsaw() throws IOException
     {
         assumeTrue( "There's no JDK 9 provided.",
-                          isJavaVersion9AtLeast() || JDK_HOME != null && 
isExtJavaVerion9AtLeast() );
-        // fail( JDK_HOME_KEY + " was provided with value " + JDK_HOME + " but 
it is not Jigsaw Java 9." );
+                          isJavaVersion9AtLeast() || EXT_JDK_HOME != null && 
isExtJavaVerion9AtLeast() );
+        // fail( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME 
+ " but it is not Jigsaw Java 9." );
 
         SurefireLauncher launcher = unpack();
 
-        if ( JDK_HOME != null )
-        {
-            launcher.setLauncherJavaHome( JDK_HOME );
-        }
-
-        return launcher;
+        return EXT_JDK_HOME == null ? launcher : launcher.setLauncherJavaHome( 
EXT_JDK_HOME );
     }
 
     protected SurefireLauncher assumeJava9Property() throws IOException
     {
-        assumeTrue( "There's no JDK 9 provided.", JDK_HOME != null && 
isExtJavaVerion9AtLeast() );
+        assumeTrue( "There's no JDK 9 provided.", EXT_JDK_HOME != null && 
isExtJavaVerion9AtLeast() );
         return unpack();
     }
 
@@ -81,12 +76,12 @@ public abstract class AbstractJigsawIT
 
     private static boolean isExtJavaVerion9AtLeast() throws IOException
     {
-        File release = new File( JDK_HOME, "release" );
+        File release = new File( EXT_JDK_HOME, "release" );
 
         if ( !release.isFile() )
         {
-            fail( JDK_HOME_KEY + " was provided with value " + JDK_HOME + " 
but file does not exist "
-                          + JDK_HOME + File.separator + "release"
+            fail( EXT_JDK_HOME_KEY + " was provided with value " + 
EXT_JDK_HOME + " but file does not exist "
+                          + EXT_JDK_HOME + File.separator + "release"
             );
         }
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
index 22841ae..5d9b7fe 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
@@ -25,6 +25,9 @@ import org.junit.Test;
 import java.io.File;
 import java.io.IOException;
 
+import static 
org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME;
+import static 
org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY;
+
 /**
  * Running Surefire on the top of JDK 9 and should be able to load
  * classes of multiple different Jigsaw modules without error.
@@ -59,7 +62,7 @@ public class Java9FullApiIT
         OutputValidator validator = assumeJava9Property()
                                             .setForkJvm()
                                             .debugLogging()
-                                            .sysProp( JDK_HOME_KEY, new File( 
JDK_HOME ).getCanonicalPath() )
+                                            .sysProp( EXT_JDK_HOME_KEY, new 
File( EXT_JDK_HOME ).getCanonicalPath() )
                                             .execute( "verify" )
                                             .verifyErrorFree( 1 );
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
index c71e5d6..099aa07 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
@@ -83,7 +83,6 @@ public class RunOrderIT
     }
 
     private OutputValidator executeWithRunOrder( String runOrder )
-        throws IOException, VerificationException
     {
         return unpack().forkMode( getForkMode() ).runOrder( runOrder 
).executeTest().verifyErrorFree( 3 );
     }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
index 1c6c971..a9fc346 100755
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
@@ -26,6 +26,8 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.apache.commons.lang3.StringUtils.isBlank;
+
 /**
  * Encapsulate all needed features to start a surefire run
  * <br>
@@ -36,6 +38,12 @@ import java.util.List;
  */
 public final class SurefireLauncher
 {
+    public static final String EXT_JDK_HOME_KEY = "jdk.home";
+
+    public static final String EXT_JDK_HOME = System.getProperty( 
EXT_JDK_HOME_KEY );
+
+    private static final File JAVA_HOME = javaHome();
+
     private final MavenLauncher mavenLauncher;
 
     private final String surefireVersion = System.getProperty( 
"surefire.version" );
@@ -66,25 +74,38 @@ public final class SurefireLauncher
         setInProcessJavaHome();
     }
 
-    public SurefireLauncher setInProcessJavaHome()
+    private static File javaHome()
     {
-        String javaHome = System.getenv( "JAVA_HOME" );
-        if ( javaHome != null && !javaHome.isEmpty() )
+        String javaHome = isBlank( EXT_JDK_HOME ) ? System.getenv( "JAVA_HOME" 
) : EXT_JDK_HOME;
+        if ( isBlank( javaHome ) )
         {
-            try
+            javaHome = System.getProperty( "java.home" );
+            File jre = new File( javaHome );
+            if ( "jre".equals( jre.getName() ) )
             {
-                File javaHomeAsDir = new File( javaHome ).getCanonicalFile();
-                if ( javaHomeAsDir.isDirectory() )
-                {
-                    setLauncherJavaHome( javaHomeAsDir.getPath() );
-                }
+                javaHome = jre.getParent();
             }
-            catch ( IOException e )
+        }
+
+        try
+        {
+            File javaHomeAsDir = new File( javaHome ).getCanonicalFile();
+            if ( !javaHomeAsDir.isDirectory() )
             {
-                throw new RuntimeException( e );
+                throw new RuntimeException( javaHomeAsDir.getAbsolutePath() + 
" is not a JAVA_HOME directory." );
             }
+            System.out.println( "Using JAVA_HOME=" + 
javaHomeAsDir.getAbsolutePath() + " in forked launcher." );
+            return javaHomeAsDir;
         }
-        return this;
+        catch ( IOException e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+
+    private void setInProcessJavaHome()
+    {
+        setLauncherJavaHome( JAVA_HOME.getPath() );
     }
 
     public SurefireLauncher setLauncherJavaHome( String javaHome )

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
index f051c1c..3ca758a 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
@@ -27,9 +27,10 @@ import org.junit.Before;
 import org.junit.Test;
 
 import java.util.Iterator;
+import java.util.concurrent.TimeUnit;
 
-import static org.apache.commons.lang.SystemUtils.IS_OS_LINUX;
-import static org.apache.commons.lang.SystemUtils.IS_OS_MAC_OSX;
+import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
+import static org.apache.commons.lang3.SystemUtils.IS_OS_MAC_OSX;
 import static org.fest.assertions.Assertions.assertThat;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeTrue;
@@ -51,7 +52,7 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
     }
 
     @Test
-    public void crashInFork() throws VerificationException
+    public void crashInFork() throws VerificationException, 
InterruptedException
     {
         SurefireLauncher launcher = unpack( "crash-during-test" );
 
@@ -59,7 +60,7 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
     }
 
     @Test
-    public void crashInSingleUseFork() throws VerificationException
+    public void crashInSingleUseFork() throws VerificationException, 
InterruptedException
     {
         SurefireLauncher launcher = unpack( "crash-during-test" )
                                             .forkCount( 1 )
@@ -69,7 +70,7 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
     }
 
     @Test
-    public void crashInReusableFork() throws VerificationException
+    public void crashInReusableFork() throws VerificationException, 
InterruptedException
     {
         SurefireLauncher launcher = unpack( "crash-during-test" )
                                             .forkPerThread()
@@ -80,14 +81,14 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
     }
 
     private static void checkCrashTypes( SurefireLauncher launcher )
-            throws VerificationException
+            throws VerificationException, InterruptedException
     {
         checkCrash( launcher.addGoal( "-DcrashType=exit" ) );
         checkCrash( launcher.addGoal( "-DcrashType=abort" ) );
         checkCrash( launcher.addGoal( "-DcrashType=segfault" ) );
     }
 
-    private static void checkCrash( SurefireLauncher launcher ) throws 
VerificationException
+    private static void checkCrash( SurefireLauncher launcher ) throws 
VerificationException, InterruptedException
     {
         OutputValidator validator = launcher.maven()
                                             .withFailure()
@@ -97,6 +98,10 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
                                             )
                                             .verifyTextInLog( "Crashed tests:" 
);
 
+        // Cannot flush log.txt stream because it is consumed internally by 
Verifier.
+        // Waiting for the stream to become flushed on disk.
+        TimeUnit.SECONDS.sleep( 1L );
+
         for ( Iterator<String> it = validator.loadLogLines().iterator(); 
it.hasNext(); )
         {
             String line = it.next();

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/environment-variables/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/environment-variables/pom.xml 
b/surefire-integration-tests/src/test/resources/environment-variables/pom.xml
index 79f4eda..902e97e 100644
--- 
a/surefire-integration-tests/src/test/resources/environment-variables/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/environment-variables/pom.xml
@@ -29,8 +29,10 @@
   <name>Test for checking environment variables into forks</name>
 
     <properties>
-          <forkMode>always</forkMode>
-          <useSystemClassLoader>false</useSystemClassLoader>
+      <forkMode>always</forkMode>
+      <useSystemClassLoader>false</useSystemClassLoader>
+      <maven.compiler.source>1.7</maven.compiler.source>
+      <maven.compiler.target>1.7</maven.compiler.target>
     </properties>
   <dependencies>
     <dependency>
@@ -56,14 +58,6 @@
           </environmentVariables>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fail-fast-junit/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fail-fast-junit/pom.xml 
b/surefire-integration-tests/src/test/resources/fail-fast-junit/pom.xml
index 6d6aca2..b82448e 100644
--- a/surefire-integration-tests/src/test/resources/fail-fast-junit/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fail-fast-junit/pom.xml
@@ -50,14 +50,6 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <runOrder>alphabetical</runOrder>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fail-fast-testng/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fail-fast-testng/pom.xml 
b/surefire-integration-tests/src/test/resources/fail-fast-testng/pom.xml
index 47e5e24..d52ad12 100644
--- a/surefire-integration-tests/src/test/resources/fail-fast-testng/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fail-fast-testng/pom.xml
@@ -47,14 +47,6 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <runOrder>alphabetical</runOrder>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml 
b/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml
index 46da1bf..8e988ad 100644
--- a/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml
+++ b/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml
@@ -18,14 +18,6 @@
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-compiler-plugin</artifactId>
-           <configuration>
-              <source>1.5</source>
-              <target>1.5</target>
-           </configuration>
-        </plugin>
-        <plugin>
-           <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>
@@ -42,5 +34,7 @@
   <properties>
     <junit.version>4.8.1</junit.version>
     <forkMode>once</forkMode>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/failsafe-notests/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/failsafe-notests/pom.xml 
b/surefire-integration-tests/src/test/resources/failsafe-notests/pom.xml
index bc414e4..24d1dec 100644
--- a/surefire-integration-tests/src/test/resources/failsafe-notests/pom.xml
+++ b/surefire-integration-tests/src/test/resources/failsafe-notests/pom.xml
@@ -21,10 +21,17 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
+
   <groupId>localhost</groupId>
   <artifactId>failsafe-notests</artifactId>
   <version>1.0</version>
   <name>failsafe-notests</name>
+
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml 
b/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
index 59f60cd..7d79f29 100644
--- 
a/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
@@ -18,14 +18,6 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
         <configuration>
@@ -40,5 +32,7 @@
   <properties>
     <junit.version>4.10</junit.version>
     <forkMode>once</forkMode>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/failureOutput/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/failureOutput/pom.xml 
b/surefire-integration-tests/src/test/resources/failureOutput/pom.xml
index 71ff2c4..85c10ee 100644
--- a/surefire-integration-tests/src/test/resources/failureOutput/pom.xml
+++ b/surefire-integration-tests/src/test/resources/failureOutput/pom.xml
@@ -19,14 +19,6 @@
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-compiler-plugin</artifactId>
-           <configuration>
-              <source>1.5</source>
-              <target>1.5</target>
-           </configuration>
-        </plugin>
-        <plugin>
-           <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>
@@ -51,6 +43,8 @@
       <printSummary>true</printSummary>
       <useFile>true</useFile>
       <reportFormat>brief</reportFormat>
+      <maven.compiler.source>1.7</maven.compiler.source>
+      <maven.compiler.target>1.7</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-consoleOutput/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fork-consoleOutput/pom.xml 
b/surefire-integration-tests/src/test/resources/fork-consoleOutput/pom.xml
index 29610f9..407d86b 100644
--- a/surefire-integration-tests/src/test/resources/fork-consoleOutput/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fork-consoleOutput/pom.xml
@@ -19,14 +19,6 @@
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-compiler-plugin</artifactId>
-           <configuration>
-              <source>1.5</source>
-              <target>1.5</target>
-           </configuration>
-        </plugin>
-        <plugin>
-           <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>
@@ -48,6 +40,8 @@
       <forkMode>once</forkMode>
       <printSummary>true</printSummary>
       <reportFormat>brief</reportFormat>
+      <maven.compiler.source>1.7</maven.compiler.source>
+      <maven.compiler.target>1.7</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/pom.xml
 
b/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/pom.xml
index fd92dde..9aa5e1b 100644
--- 
a/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/pom.xml
@@ -19,14 +19,6 @@
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-compiler-plugin</artifactId>
-           <configuration>
-              <source>1.5</source>
-              <target>1.5</target>
-           </configuration>
-        </plugin>
-        <plugin>
-           <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>
@@ -51,6 +43,8 @@
       <printSummary>true</printSummary>
       <useFile>true</useFile>
       <reportFormat>brief</reportFormat>
+      <maven.compiler.source>1.7</maven.compiler.source>
+      <maven.compiler.target>1.7</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-fail/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/fork-fail/pom.xml 
b/surefire-integration-tests/src/test/resources/fork-fail/pom.xml
index e0de5b0..9db6d72 100644
--- a/surefire-integration-tests/src/test/resources/fork-fail/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fork-fail/pom.xml
@@ -28,17 +28,15 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for failing fork</name>
 
-  <properties><argLine>-Xmxxxx712743m</argLine></properties>
+  <properties>
+    <argLine>-Xmxxxx712743m</argLine>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
         <configuration>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-mode-multimodule/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fork-mode-multimodule/pom.xml 
b/surefire-integration-tests/src/test/resources/fork-mode-multimodule/pom.xml
index 7535569..e0786b1 100644
--- 
a/surefire-integration-tests/src/test/resources/fork-mode-multimodule/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/fork-mode-multimodule/pom.xml
@@ -30,6 +30,11 @@
 
   <packaging>pom</packaging>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <modules>
     <module>module-a</module>
     <module>module-b</module>
@@ -38,14 +43,6 @@
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.3.2</version>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
         <configuration>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-mode-resource-loading/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fork-mode-resource-loading/pom.xml
 
b/surefire-integration-tests/src/test/resources/fork-mode-resource-loading/pom.xml
index 1c00ea6..e40033c 100644
--- 
a/surefire-integration-tests/src/test/resources/fork-mode-resource-loading/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/fork-mode-resource-loading/pom.xml
@@ -28,16 +28,14 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for forkMode</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
       </plugin>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-mode-testng/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/fork-mode-testng/pom.xml 
b/surefire-integration-tests/src/test/resources/fork-mode-testng/pom.xml
index a622fa5..8e25749 100644
--- a/surefire-integration-tests/src/test/resources/fork-mode-testng/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fork-mode-testng/pom.xml
@@ -12,16 +12,14 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for forkMode</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
         <configuration>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-mode/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/fork-mode/pom.xml 
b/surefire-integration-tests/src/test/resources/fork-mode/pom.xml
index cf77bb0..28bfb4d 100644
--- a/surefire-integration-tests/src/test/resources/fork-mode/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fork-mode/pom.xml
@@ -28,16 +28,14 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for forkMode</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
         <configuration>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml 
b/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml
index c0d03c5..25365a2 100644
--- a/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml
+++ b/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml
@@ -12,6 +12,8 @@
     <junit.parallel>classes</junit.parallel>
     <forkMode>once</forkMode>
     <timeOut>1</timeOut>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
   <dependencies>
       <dependency>
@@ -24,11 +26,6 @@
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-compiler-plugin</artifactId>
-           <version>2.3.2</version>
-        </plugin>
-        <plugin>
-           <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/includes-excludes-from-file/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/includes-excludes-from-file/pom.xml
 
b/surefire-integration-tests/src/test/resources/includes-excludes-from-file/pom.xml
index 025f182..39313db 100644
--- 
a/surefire-integration-tests/src/test/resources/includes-excludes-from-file/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/includes-excludes-from-file/pom.xml
@@ -31,6 +31,8 @@ under the License.
 
   <properties>
     <junit.version>3.8.2</junit.version>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml 
b/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
index 504171e..77711f7 100644
--- a/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
+++ b/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
@@ -31,10 +31,10 @@ under the License.
 
   <properties>
     <junit.version>3.8.2</junit.version>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
-
-
   <dependencies>
     <dependency>
       <artifactId>junit</artifactId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/isolated-classloader/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/isolated-classloader/pom.xml 
b/surefire-integration-tests/src/test/resources/isolated-classloader/pom.xml
index dbed07b..a853063 100644
--- a/surefire-integration-tests/src/test/resources/isolated-classloader/pom.xml
+++ b/surefire-integration-tests/src/test/resources/isolated-classloader/pom.xml
@@ -28,6 +28,10 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for useSystemClassLoader=false</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
 
   <build>
     <plugins>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/java9-full-api/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/java9-full-api/pom.xml 
b/surefire-integration-tests/src/test/resources/java9-full-api/pom.xml
index dc44fb7..2e4d4f3 100644
--- a/surefire-integration-tests/src/test/resources/java9-full-api/pom.xml
+++ b/surefire-integration-tests/src/test/resources/java9-full-api/pom.xml
@@ -32,11 +32,6 @@
 
     <artifactId>java9-full-api</artifactId>
 
-    <properties>
-        <maven.compiler.source>1.6</maven.compiler.source>
-        <maven.compiler.target>1.6</maven.compiler.target>
-    </properties>
-
     <build>
         <plugins>
             <plugin>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-fork-mode-always/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/junit-fork-mode-always/pom.xml 
b/surefire-integration-tests/src/test/resources/junit-fork-mode-always/pom.xml
index ed2d930..9b86c75 100644
--- 
a/surefire-integration-tests/src/test/resources/junit-fork-mode-always/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/junit-fork-mode-always/pom.xml
@@ -28,21 +28,18 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for forkMode</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
-       <version>${surefire.version}</version>
+           <version>${surefire.version}</version>
         <configuration>
           <forkMode>${forkMode}</forkMode>
-
         </configuration>
       </plugin>
     </plugins>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-ignore/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit-ignore/pom.xml 
b/surefire-integration-tests/src/test/resources/junit-ignore/pom.xml
index a73c362..d9c3817 100644
--- a/surefire-integration-tests/src/test/resources/junit-ignore/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit-ignore/pom.xml
@@ -32,6 +32,8 @@
     <junit.version>4.4</junit.version>
     <surefire.parallel></surefire.parallel>
     <surefire.threadcount>3</surefire.threadcount>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
   <dependencies>
@@ -46,14 +48,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
         <configuration>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-innerClass/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/junit-innerClass/pom.xml 
b/surefire-integration-tests/src/test/resources/junit-innerClass/pom.xml
index 40b5060..fb1ffd6 100644
--- a/surefire-integration-tests/src/test/resources/junit-innerClass/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit-innerClass/pom.xml
@@ -28,6 +28,11 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test JUnit classes with inner classes</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
 
b/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
index e459f45..8a95201 100644
--- 
a/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
@@ -28,6 +28,11 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for JUnit tests that don't extend TestCase</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-pathWithUmlaut/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/junit-pathWithUmlaut/pom.xml 
b/surefire-integration-tests/src/test/resources/junit-pathWithUmlaut/pom.xml
index 321aba7..890839e 100644
--- a/surefire-integration-tests/src/test/resources/junit-pathWithUmlaut/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit-pathWithUmlaut/pom.xml
@@ -28,6 +28,11 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test path with Ümlaut</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-twoTestCaseSuite/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/junit-twoTestCaseSuite/pom.xml 
b/surefire-integration-tests/src/test/resources/junit-twoTestCaseSuite/pom.xml
index 0e2a12c..f2075ae 100644
--- 
a/surefire-integration-tests/src/test/resources/junit-twoTestCaseSuite/pom.xml
+++ 
b/surefire-integration-tests/src/test/resources/junit-twoTestCaseSuite/pom.xml
@@ -28,6 +28,11 @@
   <version>1.0-SNAPSHOT</version>
   <name>Test for single suite with two test cases</name>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <build>
     <plugins>
       <plugin>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e93cfd72/surefire-integration-tests/src/test/resources/junit-twoTestCases/pom.xml
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/resources/junit-twoTestCases/pom.xml 
b/surefire-integration-tests/src/test/resources/junit-twoTestCases/pom.xml
index e74f485..89684ad 100644
--- a/surefire-integration-tests/src/test/resources/junit-twoTestCases/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit-twoTestCases/pom.xml
@@ -23,6 +23,11 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
 
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
   <groupId>org.apache.maven.plugins.surefire</groupId>
   <artifactId>junit-twoTestCases</artifactId>
   <version>1.0-SNAPSHOT</version>

Reply via email to