You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/10/02 20:25:47 UTC

svn commit: r1393086 - in /maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182: ./ invoker.properties pom.xml src/ src/main/ src/main/java/ src/main/java/BeanA.java src/main/java/BeanA2.java verify.groovy

Author: rfscholte
Date: Tue Oct  2 18:25:46 2012
New Revision: 1393086

URL: http://svn.apache.org/viewvc?rev=1393086&view=rev
Log:
[MCOMPILER-182] Case sensitivity changes in class names not detected by compiler 

Added:
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/invoker.properties
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA2.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/verify.groovy

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/invoker.properties?rev=1393086&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/invoker.properties (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/invoker.properties Tue Oct  2 18:25:46 2012
@@ -0,0 +1,4 @@
+invoker.goals = clean compile
+invoker.goals.2 = org.codehaus.gmaven:gmaven-plugin:execute
+invoker.goals.3 = compile
+invoker.buildResult.3 = failure
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/pom.xml?rev=1393086&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/pom.xml (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/pom.xml Tue Oct  2 18:25:46 2012
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>org.apache.maven.plugins.compiler.its</groupId>
+  <artifactId>mcompiler-182</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <description>
+    This IT tests what happens if the class name (and filename) of BeanA gets changed.
+    In this case 'mvn compile' (without a clean) should fail as BeanA2
+    still uses the old BeanA.
+  </description>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>      
+      </plugins>
+    </pluginManagement> 
+    <plugins>
+      <plugin>
+        <!-- Called as second invoker goal to simulate file adjustment -->
+        <groupId>org.codehaus.gmaven</groupId>
+        <artifactId>gmaven-plugin</artifactId>
+        <version>1.4</version>
+        <configuration>
+          <source>
+            def beanAFile = new File( project.basedir, 'src/main/java/BeanA.java' )
+            
+            new File( project.basedir, 'src/main/java/BEANa.java' ).withWriter { file ->
+              beanAFile.eachLine { line ->
+                file.writeLine( line.replace( 'BeanA', 'BEANa' ) )
+              }
+            }
+            
+            beanAFile.delete()
+          </source>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA.java?rev=1393086&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA.java Tue Oct  2 18:25:46 2012
@@ -0,0 +1,15 @@
+/**
+ * dumb test bean
+ */
+public class BeanA {
+
+    private int i,y;
+
+    public int getI() {
+        return i;
+    }
+
+    public void setI(int i) {
+        this.i = i;
+    }
+}

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA2.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA2.java?rev=1393086&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA2.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/src/main/java/BeanA2.java Tue Oct  2 18:25:46 2012
@@ -0,0 +1,16 @@
+/**
+ * dumb test bean
+ */
+public class BeanA2 {
+
+    private int i;
+    private BeanA beanA;
+
+    public int getI() {
+        return beanA.getI();
+    }
+
+    public void setI(int i) {
+        beanA.setI(i);
+    }
+}

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/verify.groovy?rev=1393086&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/verify.groovy (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-182/verify.groovy Tue Oct  2 18:25:46 2012
@@ -0,0 +1,26 @@
+
+/*
+ * 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.
+ */
+def logFile = new File( basedir, 'build.log' )
+assert logFile.exists()
+content = logFile.text
+
+assert content.contains( 'COMPILATION ERROR :' )
+
+assert !new File( basedir, 'target/classes/BeanA.class' ).exists();