This is an automated email from the ASF dual-hosted git repository. khmarbaise pushed a commit to branch MCOMPILER-338 in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git
commit a6ade076d0323488ddae27161960f18eadea2b53 Author: Karl Heinz Marbaise <khmarba...@apache.org> AuthorDate: Sat Apr 14 11:24:01 2018 +0200 [MCOMPILER-338] Build Issue based on MCOMPILER-192 IT o The build issues where not only based on MCOMPILER-192 also on other areas of the builds which resulted on problems. o Upgrade surefire.version to 2.21.0 (to work in JDK 10) o MCOMPILER-197 o need to limit the run to 1.6..1.8 o groovy-project-with-new-plexus-compiler o need to limit the run to 1.6..1.8 o MCOMPILER-192 IT o Identification in the log file needed to be changed based on different OS/JDK's/Platform outputs. This is not an elegant solution its a working solution. --- Jenkinsfile | 2 +- pom.xml | 3 ++- src/it/MCOMPILER-192/pom.xml | 3 +++ src/it/MCOMPILER-192/verify.groovy | 25 ++++++++++++++++++---- src/it/MCOMPILER-197/invoker.properties | 2 +- .../invoker.properties | 2 +- .../plugin/compiler/CompilerMojoTestCase.java | 6 +++++- 7 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 09ac70f..244b345 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,4 +17,4 @@ * under the License. */ -asfMavenTlpStdBuild() +asfMavenTlpStdBuild( [ 'failFast' : false ] ) diff --git a/pom.xml b/pom.xml index 8bc46d8..d1b112d 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ under the License. </distributionManagement> <properties> + <surefire.version>2.21.0</surefire.version> <mavenVersion>3.0</mavenVersion> <!-- ! The following property is used in the integration tests MCOMPILER-157 @@ -72,7 +73,7 @@ under the License. <groovyVersion>1.8.0</groovyVersion> <groovyEclipseCompilerVersion>2.7.0-01</groovyEclipseCompilerVersion> <groovy-eclipse-batch>2.0.4-04</groovy-eclipse-batch> - <openJpaVersion>2.2.0</openJpaVersion> + <openJpaVersion>2.4.2</openJpaVersion> <javaVersion>7</javaVersion> <maven.it.failure.ignore>false</maven.it.failure.ignore> </properties> diff --git a/src/it/MCOMPILER-192/pom.xml b/src/it/MCOMPILER-192/pom.xml index 6cb5c74..2e38b5a 100644 --- a/src/it/MCOMPILER-192/pom.xml +++ b/src/it/MCOMPILER-192/pom.xml @@ -29,6 +29,9 @@ under the License. <version>1.0</version> <packaging>jar</packaging> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> <build> <plugins> <plugin> diff --git a/src/it/MCOMPILER-192/verify.groovy b/src/it/MCOMPILER-192/verify.groovy index b6785e2..0bdd307 100644 --- a/src/it/MCOMPILER-192/verify.groovy +++ b/src/it/MCOMPILER-192/verify.groovy @@ -19,10 +19,27 @@ */ def logFile = new File( basedir, 'build.log' ) assert logFile.exists() -content = logFile.text -// Disable for Jenkins. Once fixed, this test will fail again. In that case remove the JENKINS_URL again. -if( !content.contains( 'Usage: javac <options> <source files>' ) ^ System.getenv( 'JENKINS_URL') != null ){ - throw new RuntimeException( "log not containing Usage: javac <options> <source files> but <startLog>" + content + "</startLog>") +def content = logFile.getText('UTF-8') + +def causedByExpected = content.contains ( 'Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure' ) +def twoFilesBeingCompiled = content.contains ( '[INFO] Compiling 2 source files to ' ) +def checkResult = content.contains ( '[INFO] BUILD FAILURE' ) +def compilationFailure1 = content.contains( '[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:') + +// This is the message on JDK 7 / Windows +// [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.1-SNAPSHOT:compile (default-compile) on project blah: Compilation failure +// This is the message on JKD 8 / Linux +// [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.1-SNAPSHOT:compile (default-compile) on project blah: Compilation failure -> [Help 1] + +def compilationFailure2 = content.contains( ':compile (default-compile) on project blah: Compilation failure') + +println "Jenkins: causedByExpected:${causedByExpected} twoFilesBeingCompiled:${twoFilesBeingCompiled} checkResult: ${checkResult} compilationFailure1: ${compilationFailure1} compilationFailure2: ${compilationFailure2}" + +// We need to combine different identification to handle differences between OS's and JDK's. +def finalResult = twoFilesBeingCompiled && checkResult && causedByExpected && compilationFailure1 && compilationFailure2 + +if ( !finalResult ) { + throw new RuntimeException( "log does not contain expected result to be failed but <startLog>" + content + "</startLog>") } diff --git a/src/it/MCOMPILER-197/invoker.properties b/src/it/MCOMPILER-197/invoker.properties index 85857ca..3f8fa04 100644 --- a/src/it/MCOMPILER-197/invoker.properties +++ b/src/it/MCOMPILER-197/invoker.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -invoker.java.version = 1.6+ +invoker.java.version = 1.6, 1.7, 1.8 diff --git a/src/it/MCOMPILER-197/invoker.properties b/src/it/groovy-project-with-new-plexus-compiler/invoker.properties similarity index 95% copy from src/it/MCOMPILER-197/invoker.properties copy to src/it/groovy-project-with-new-plexus-compiler/invoker.properties index 85857ca..3f8fa04 100644 --- a/src/it/MCOMPILER-197/invoker.properties +++ b/src/it/groovy-project-with-new-plexus-compiler/invoker.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -invoker.java.version = 1.6+ +invoker.java.version = 1.6, 1.7, 1.8 diff --git a/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java b/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java index 7022155..dfa5ec5 100644 --- a/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java +++ b/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java @@ -58,7 +58,11 @@ public class CompilerMojoTestCase super.setUp(); String javaSpec = System.getProperty( "java.specification.version" ); - if ( "9".equals( javaSpec ) ) + // It is needed to set target/source to JDK 6 for JDK9 and JDK10 + // cause this is the lowest version which is supported by those JDK's. + // The default source/target "5" is not supported anymore. + // See https://issues.apache.org/jira/browse/MCOMPILER-338 + if ( "9".equals( javaSpec ) || "10".equals ( javaSpec ) ) { source = "6"; target = "6"; -- To stop receiving notification emails like this one, please contact khmarba...@apache.org.