You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/03/25 21:42:42 UTC

[maven-compiler-plugin] 01/01: This fixes MCOMPILER-192 IT o The previous assumption about identification was wrong and needed to be changed. Fixing MCOMPILER-197 o Run only for Java 1.6..1.8 Fixing groovy-project-with-new-plexus-compiler o Run only for Java 1.6..1.8

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch TEST_TO_FIX_MCOMPILER-192
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git

commit 8aed6fecd85cc6a1e2dc5c652e6c72eff3ec73f4
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Mar 25 23:41:14 2018 +0200

    This fixes MCOMPILER-192 IT
     o The previous assumption about identification was wrong
       and needed to be changed.
    Fixing MCOMPILER-197
     o Run only for Java 1.6..1.8
    Fixing groovy-project-with-new-plexus-compiler
     o Run only for  Java 1.6..1.8
---
 Jenkinsfile                                        |  2 +-
 pom.xml                                            |  2 +-
 src/it/MCOMPILER-192/pom.xml                       |  3 +++
 src/it/MCOMPILER-192/verify.groovy                 | 29 +++++++++++++++++++---
 src/it/MCOMPILER-197/invoker.properties            |  2 +-
 .../invoker.properties                             |  2 +-
 6 files changed, 32 insertions(+), 8 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..ab73469 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,7 +72,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..441857f 100644
--- a/src/it/MCOMPILER-192/verify.groovy
+++ b/src/it/MCOMPILER-192/verify.groovy
@@ -19,10 +19,31 @@
  */
 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 jenkins = System.getenv ( 'JENKINS_URL' );
+
+println "Jenkins: ${jenkins}"
+
+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

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.