You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gb...@apache.org on 2017/06/04 17:26:27 UTC

svn commit: r1797596 - in /maven/plugins/trunk/maven-checkstyle-plugin/src: it/MCHECKSTYLE-337/ it/MCHECKSTYLE-337/src/ it/MCHECKSTYLE-337/src/main/ it/MCHECKSTYLE-337/src/main/java/ it/MCHECKSTYLE-337/src/main/java/org/ main/java/org/apache/maven/plug...

Author: gboue
Date: Sun Jun  4 17:26:27 2017
New Revision: 1797596

URL: http://svn.apache.org/viewvc?rev=1797596&view=rev
Log:
[MCHECKSTYLE-337] checkstyle:check only supports xml output format, but the docs say it supports plain as well
Submitted by: Stig Rohde Døssing

Adding support for 'plain' output file format in the 'check' goal. It is still not possible to use it in combination with 'skipExec' because the plain format does not interact fully with 'violationIgnore' (which can contain fully qualified class name, when Checkstyle plain format only has the class simple name).

Added:
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/invoker.properties   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/pom.xml   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/verify.groovy   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml   (with props)
Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojoTest.java

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/invoker.properties?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/invoker.properties (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/invoker.properties Sun Jun  4 17:26:27 2017
@@ -0,0 +1,20 @@
+# 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.
+
+invoker.goals = verify
+invoker.buildResult = failure
+invoker.mavenOpts = -Duser.language=en -Duser.country=US -Duser.variant=US

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

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

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/pom.xml?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/pom.xml (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/pom.xml Sun Jun  4 17:26:27 2017
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<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.checkstyle</groupId>
+  <artifactId>MCHECKSTYLE-337</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <url>http://maven.apache.org/</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <checkstyle.violation.ignore>NewlineAtEndOfFile</checkstyle.violation.ignore>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>@pom.version@</version>
+        <executions>
+          <execution>
+            <id>check</id>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <outputFile>${project.build.directory}/checkstyle-result.txt</outputFile>
+              <outputFileFormat>plain</outputFileFormat>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java Sun Jun  4 17:26:27 2017
@@ -0,0 +1,27 @@
+package org;
+
+/*
+ * 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.
+ */
+
+/**
+ * My class.
+ */
+public class MyClass
+{
+}

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/MyClass.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java Sun Jun  4 17:26:27 2017
@@ -0,0 +1,23 @@
+/**
+ * Nothing very important here, only a file for checkstyle rule PackageInfo.
+ */
+package org;
+
+/*
+ * 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.
+ */

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/src/main/java/org/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/verify.groovy?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/verify.groovy (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/verify.groovy Sun Jun  4 17:26:27 2017
@@ -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 buildLog = new File( basedir, 'build.log' )
+
+assert buildLog.text.contains( "You have 1 Checkstyle violation" )
+
+def checkstyleResult = new File( basedir, "target/checkstyle-result.txt" )
+
+assert checkstyleResult.text.contains( "'{' at column 1 should be on the previous line. [LeftCurly]" )

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-337/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java?rev=1797596&r1=1797595&r2=1797596&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java Sun Jun  4 17:26:27 2017
@@ -485,6 +485,8 @@ public class CheckstyleViolationCheckMoj
 
     private ByteArrayOutputStream stringOutputStream;
 
+    private File outputXmlFile;
+
     /** {@inheritDoc} */
     public void execute()
         throws MojoExecutionException, MojoFailureException
@@ -496,6 +498,8 @@ public class CheckstyleViolationCheckMoj
             return;
         }
 
+        outputXmlFile = outputFile;
+
         if ( !skipExec )
         {
             if ( checkstyleRules != null )
@@ -564,19 +568,19 @@ public class CheckstyleViolationCheckMoj
             }
         }
 
-        if ( !"xml".equals( outputFileFormat ) )
+        if ( !"xml".equals( outputFileFormat ) && skipExec )
         {
             throw new MojoExecutionException( "Output format is '" + outputFileFormat
-                + "', checkstyle:check requires format to be 'xml'." );
+                + "', checkstyle:check requires format to be 'xml' when using skipExec." );
         }
 
-        if ( !outputFile.exists() )
+        if ( !outputXmlFile.exists() )
         {
             getLog().info( "Unable to perform checkstyle:check, unable to find checkstyle:checkstyle outputFile." );
             return;
         }
 
-        try ( Reader reader = new BufferedReader( ReaderFactory.newXmlReader( outputFile ) ) )
+        try ( Reader reader = new BufferedReader( ReaderFactory.newXmlReader( outputXmlFile ) ) )
         {
             XmlPullParser xpp = new MXParser();
             xpp.setInput( reader );
@@ -601,8 +605,8 @@ public class CheckstyleViolationCheckMoj
         }
         catch ( IOException | XmlPullParserException e )
         {
-            throw new MojoExecutionException( "Unable to read Checkstyle results xml: " + outputFile.getAbsolutePath(),
-                                              e );
+            throw new MojoExecutionException( "Unable to read Checkstyle results xml: "
+                + outputXmlFile.getAbsolutePath(), e );
         }
     }
 
@@ -799,7 +803,22 @@ public class CheckstyleViolationCheckMoj
             }
             else if ( "plain".equals( outputFileFormat ) )
             {
-                listener = new DefaultLogger( out, true );
+                try
+                {
+                    // Write a plain output file to the standard output file,
+                    // and write an XML output file to the temp directory that can be used to count violations
+                    outputXmlFile = File.createTempFile( "checkstyle-result", ".xml" );
+                    outputXmlFile.deleteOnExit();
+                    OutputStream xmlOut = getOutputStream( outputXmlFile );
+                    CompositeAuditListener compoundListener = new CompositeAuditListener();
+                    compoundListener.addListener( new XMLLogger( xmlOut, true ) );
+                    compoundListener.addListener( new DefaultLogger( out, true ) );
+                    listener = compoundListener;
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoExecutionException( "Unable to create temporary file", e );
+                }
             }
             else
             {

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java Sun Jun  4 17:26:27 2017
@@ -0,0 +1,96 @@
+package org.apache.maven.plugins.checkstyle;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.puppycrawl.tools.checkstyle.api.AuditEvent;
+import com.puppycrawl.tools.checkstyle.api.AuditListener;
+
+/**
+ * AuditListener that forwards events to a list of other AuditListeners
+ */
+public class CompositeAuditListener
+    implements AuditListener
+{
+
+    private final List<AuditListener> delegates = new ArrayList<>();
+
+    public void addListener( AuditListener listener )
+    {
+        delegates.add( listener );
+    }
+
+    @Override
+    public void auditStarted( AuditEvent event )
+    {
+        for ( AuditListener listener : delegates )
+        {
+            listener.auditStarted( event );
+        }
+    }
+
+    @Override
+    public void auditFinished( AuditEvent event )
+    {
+        for ( AuditListener listener : delegates )
+        {
+            listener.auditFinished( event );
+        }
+    }
+
+    @Override
+    public void fileStarted( AuditEvent event )
+    {
+        for ( AuditListener listener : delegates )
+        {
+            listener.fileStarted( event );
+        }
+    }
+
+    @Override
+    public void fileFinished( AuditEvent event )
+    {
+        for ( AuditListener listener : delegates )
+        {
+            listener.fileFinished( event );
+        }
+    }
+
+    @Override
+    public void addError( AuditEvent event )
+    {
+        for ( AuditListener listener : delegates )
+        {
+            listener.addError( event );
+        }
+    }
+
+    @Override
+    public void addException( AuditEvent event, Throwable throwable )
+    {
+        for ( AuditListener listener : delegates )
+        {
+            listener.addException( event, throwable );
+        }
+    }
+
+}

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CompositeAuditListener.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojoTest.java?rev=1797596&r1=1797595&r2=1797596&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojoTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojoTest.java Sun Jun  4 17:26:27 2017
@@ -26,6 +26,7 @@ import org.apache.maven.model.Build;
 import org.apache.maven.plugin.Mojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 import org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo;
@@ -65,7 +66,7 @@ public class CheckstyleViolationCheckMoj
         }
     }
 
-    public void testInvalidFormat()
+    public void testInvalidFormatWithSkipExec()
         throws Exception
     {
         File pluginXmlFile = new File( getBasedir(), "src/test/plugin-configs/check-plugin-config.xml" );
@@ -106,6 +107,46 @@ public class CheckstyleViolationCheckMoj
         mojo.execute();
     }
 
+    private void doTestPlainOutputFile( boolean failsOnError )
+        throws Exception
+    {
+        File pluginXmlFile = new File( getBasedir(), "src/test/plugin-configs/check-plugin-plain-output.xml" );
+
+        Mojo mojo = lookupMojo( "check", pluginXmlFile );
+
+        assertNotNull( "Mojo found.", mojo );
+
+        PluginDescriptor descriptorStub = new PluginDescriptor();
+        descriptorStub.setGroupId( "org.apache.maven.plugins" );
+        descriptorStub.setArtifactId( "maven-checkstyle-plugin" );
+        setVariableValueToObject( mojo, "plugin", descriptorStub );
+
+        setVariableValueToObject( mojo, "failsOnError", failsOnError );
+
+        mojo.execute();
+    }
+
+    public void testPlainOutputFileFailOnError()
+        throws Exception
+    {
+        try
+        {
+            doTestPlainOutputFile( true );
+
+            fail( "Must fail on violations" );
+        }
+        catch ( MojoExecutionException e )
+        {
+            // expected
+        }
+    }
+
+    public void testPlainOutputFile()
+        throws Exception
+    {
+        doTestPlainOutputFile( false );
+    }
+
     public void testNoFail()
         throws Exception
     {

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml?rev=1797596&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml Sun Jun  4 17:26:27 2017
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>sun_checks.xml</configLocation>
+          <cacheFile>${basedir}/target/test-harness/checkstyle/check-plugin-plain-output/checkstyle-cachefile</cacheFile>
+          <outputFile>${basedir}/target/test-harness/checkstyle/check-plugin-plain-output/checkstyle-result.txt</outputFile>
+          <outputFileFormat>plain</outputFileFormat>
+          <failsOnError>true</failsOnError>
+          <sourceDirectories>
+            <sourceDirectory>${basedir}/src/test/test-sources</sourceDirectory>
+          </sourceDirectories>
+          <project implementation="org.apache.maven.plugins.checkstyle.stubs.MinMavenProjectStub"/>
+          <consoleOutput>false</consoleOutput>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/check-plugin-plain-output.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision