Checkstyle plugin doesn't work with Maven 2.1
---------------------------------------------

                 Key: MCHECKSTYLE-75
                 URL: http://jira.codehaus.org/browse/MCHECKSTYLE-75
             Project: Maven 2.x Checkstyle Plugin
          Issue Type: Bug
    Affects Versions: 2.1
            Reporter: Vincent Massol


Running "mvn clean install" with the following configuration fails:

{code}
  <build>
    <plugins>
...
      <plugin>
        <!-- Apply the Checkstyle configurations defined in the top level 
pom.xml file -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>com.xpn.xwiki.platform</groupId>
            <artifactId>xwiki-build-verifications</artifactId>
            <version>1.1</version>
          </dependency>
        </dependencies>
        <configuration>
          <includes>
              **/Api.java,
              **/xmlrpc/ConfluenceRpcInterface,
              **/xmlrpc/Attachment.java,
              **/xmlrpc/SpaceSummary.java,
              **/ViewAction.java,
              **/ZipExplorer*.java,
              **/FileUpload*.java,
              **/PluginApi.java,
              **/content/**/*.java,
              **/XWikiMessageTool.java,
              **/XWikiListFilter.java,
              **/MyPersistentLoginManager.java
          </includes>
          <excludes>
              **/RenamePageReplaceLinkHandler.java
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
{code}

I have the following in the top level pom:
{code}
  <build>
    <pluginManagement>
      <plugins>
        <!-- Apply checkstyle rules and fail the build in case of errors. The 
checkstyle config
             files are taken from the build-tools JAR module.-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>com.xpn.xwiki.platform</groupId>
              <artifactId>xwiki-build-verifications</artifactId>
            </dependency>
          </dependencies>
          <configuration>
            <consoleOutput>true</consoleOutput>
            <configLocation>checkstyle.xml</configLocation>
            <headerLocation>checkstyle.license</headerLocation>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
...
{code}

The error I get:

{noformat}
...
[DEBUG] Mojo: check has config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <includes>**/Api.java,
              **/xmlrpc/ConfluenceRpcInterface,
              **/xmlrpc/Attachment.java,
              **/xmlrpc/SpaceSummary.java,
              **/ViewAction.java,
              **/ZipExplorer*.java,
              **/FileUpload*.java,
              **/PluginApi.java,
              **/content/**/*.java,
              **/XWikiMessageTool.java,
              **/XWikiListFilter.java,
              **/MyPersistentLoginManager.java</includes>
  <excludes>**/RenamePageReplaceLinkHandler.java</excludes>
  <consoleOutput>true</consoleOutput>
  <configLocation>checkstyle.xml</configLocation>
  <headerLocation>checkstyle.license</headerLocation>
</configuration>
[DEBUG] In verifyVersionedPlugin for: 
org.apache.maven.plugins:maven-checkstyle-plugin
[DEBUG] maven-checkstyle-plugin: using locally installed snapshot
[DEBUG] 
org.apache.maven.plugins:maven-checkstyle-plugin:maven-plugin:2.2-SNAPSHOT:runtime
 (selected for runtime)
...
[DEBUG] Looking up mojo 
org.apache.maven.plugins:maven-checkstyle-plugin:2.2-SNAPSHOT:check in realm 
org.apache.maven.plugins:maven-checkstyle-plugin - 
descRealmId=org.apache.maven.plugins:maven-checkstyle-plugin
[DEBUG] Looked up - [EMAIL PROTECTED] - 
ClassRealm[org.apache.maven.plugins:maven-checkstyle-plugin, parent: 
ClassRealm[plexus.core, parent: null]]
[DEBUG] Configuring mojo 
'org.apache.maven.plugins:maven-checkstyle-plugin:2.2-SNAPSHOT:check' -->
[DEBUG]   (f) failOnViolation = true
[DEBUG]   (f) outputFile = 
/Users/vmassol/dev/xwiki/trunks-devs/xwiki-platform-core/target/checkstyle-result.xml
[DEBUG]   (f) outputFileFormat = xml
[DEBUG]   (f) skip = false
[DEBUG] -- end configuration --
[INFO] [checkstyle:check]
[INFO] Unable to perform checkstyle:check, unable to find checkstyle:checkstyle 
outputFile.
...
{noformat}

The strange thing is that if I run "mvn checkstyle:checkstyle" or "mvn 
checkstyle:check", it works fine...

Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to