You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2010/02/19 22:48:58 UTC

svn commit: r911998 - in /maven/plugins/trunk/maven-checkstyle-plugin/src: it/MCHECKSTYLE-131/ it/MCHECKSTYLE-131/module/ it/MCHECKSTYLE-131/module/src/ it/MCHECKSTYLE-131/module/src/main/ it/MCHECKSTYLE-131/module/src/main/java/ it/MCHECKSTYLE-131/mod...

Author: olamy
Date: Fri Feb 19 21:48:57 2010
New Revision: 911998

URL: http://svn.apache.org/viewvc?rev=911998&view=rev
Log:
[MCHECKSTYLE-131] Plugin can't use configLocation from parent.

Added:
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/resources/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml   (with props)
Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml?rev=911998&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml Fri Feb 19 21:48:57 2010
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+</module>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/checkstyle.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties?rev=911998&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties Fri Feb 19 21:48:57 2010
@@ -0,0 +1 @@
+invoker.goals=clean checkstyle:checkstyle checkstyle:check

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml?rev=911998&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml Fri Feb 19 21:48:57 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>example</artifactId>
+    <groupId>com.mycompany</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>com.mycompany</groupId>
+  <artifactId>module</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Example Module</name>
+  <packaging>jar</packaging>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java?rev=911998&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java Fri Feb 19 21:48:57 2010
@@ -0,0 +1,11 @@
+package example.module;
+
+/**
+ *
+ * @author Frederic
+ */
+public class Example {
+
+    public void test() {
+    }
+}

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/module/src/main/java/example/module/Example.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml?rev=911998&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml Fri Feb 19 21:48:57 2010
@@ -0,0 +1,35 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.mycompany</groupId>
+  <artifactId>example</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>Example</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <modules>
+    <module>module</module>
+  </modules>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>@pom.version@</version>
+        <configuration>
+          <configLocation>checkstyle.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-131/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java?rev=911998&r1=911997&r2=911998&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java Fri Feb 19 21:48:57 2010
@@ -35,6 +35,7 @@
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.resource.ResourceManager;
 import org.codehaus.plexus.resource.loader.FileResourceCreationException;
+import org.codehaus.plexus.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
@@ -456,7 +457,15 @@
             {
                 getLogger().debug( "request.getConfigLocation() " + request.getConfigLocation() );
             }
-           
+            File parent = request.getProject().getFile().getParentFile();
+            if (parent != null)
+            {
+                // MCHECKSTYLE-131 ( olamy ) I don't like this hack. what's happened if this is defined in parent/parent pom 
+                // it will breaks
+                locator.addSearchPath( FileResourceLoader.ID, request.getProject().getFile().getParentFile().getAbsolutePath() );
+            }
+            locator.addSearchPath( "url", "" );
+            
             File configFile = locator.getResourceAsFile( request.getConfigLocation(), "checkstyle-checker.xml" );
 
             if ( configFile == null )