You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/12/20 23:30:46 UTC

[maven-checkstyle-plugin] branch MCHECKSTYLE-399 updated (a783c23 -> 6ff79bd)

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

slachiewicz pushed a change to branch MCHECKSTYLE-399
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git.


 discard a783c23  [MCHECKSTYLE-399] Upgrade Checkstyle to 8.38
     add 102e135  Add Github Actions tests for Java 8, 11, 16-ea and 17-ea
     add 358c969  Bump animal-sniffer-maven-plugin from 1.18 to 1.19
     add 7b92b74  Update maven-project-info-reports-plugin to 3.1.1
     add 29ab795  [MCHECKSTYLE-392] Update historical release notes
     new 6ff79bd  [MCHECKSTYLE-399] Upgrade Checkstyle to 8.38

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (a783c23)
            \
             N -- N -- N   refs/heads/MCHECKSTYLE-399 (6ff79bd)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven.yml                        | 51 ++++++++++++++
 pom.xml                                            |  7 +-
 .../checkstyle/exec/DefaultCheckstyleExecutor.java | 79 ----------------------
 src/site/markdown/history.md.vm                    | 26 ++++---
 4 files changed, 74 insertions(+), 89 deletions(-)
 create mode 100644 .github/workflows/maven.yml


[maven-checkstyle-plugin] 01/01: [MCHECKSTYLE-399] Upgrade Checkstyle to 8.38

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MCHECKSTYLE-399
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git

commit 6ff79bdf445ee55783eb2a87011a9b1d325066a4
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Dec 20 22:33:10 2020 +0100

    [MCHECKSTYLE-399] Upgrade Checkstyle to 8.38
---
 pom.xml                                            |  9 +--
 .../checkstyle/exec/DefaultCheckstyleExecutor.java | 79 ----------------------
 2 files changed, 1 insertion(+), 87 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3fdedd1..3a0ed40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@ under the License.
     <!-- Because Checkstyle 7+ requires Java 8 -->
     <javaVersion>8</javaVersion>
     <mavenVersion>3.0</mavenVersion>
-    <checkstyleVersion>8.29</checkstyleVersion>
+    <checkstyleVersion>8.38</checkstyleVersion>
     <doxiaVersion>1.4</doxiaVersion>
     <sitePluginVersion>3.9.0</sitePluginVersion>
     <project.build.outputTimestamp>2020-02-08T08:24:16Z</project.build.outputTimestamp>
@@ -207,13 +207,6 @@ under the License.
       <groupId>com.puppycrawl.tools</groupId>
       <artifactId>checkstyle</artifactId>
       <version>${checkstyleVersion}</version>
-      <exclusions>
-        <!-- MCHECKSTYLE-156 -->
-        <exclusion>
-          <groupId>com.sun</groupId>
-          <artifactId>tools</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
 
     <!-- misc -->
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
index 94a01e0..99a80df 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
@@ -26,9 +26,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -155,8 +152,6 @@ public class DefaultCheckstyleExecutor
                                     testSourceDirectories );
         }
 
-        setUpCheckstyleClassloader( checker, classPathStrings, outputDirectories );
-
         checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );
 
         if ( filterSet != null )
@@ -257,80 +252,6 @@ public class DefaultCheckstyleExecutor
         return checkerListener.getResults();
     }
 
-    private void setUpCheckstyleClassloader( Checker checker,
-                                             List<String> classPathStrings,
-                                             List<String> outputDirectories )
-        throws CheckstyleExecutorException
-    {
-        final List<URL> urls = new ArrayList<>( classPathStrings.size() );
-
-        for ( String path : classPathStrings )
-        {
-            try
-            {
-                urls.add( new File( path ).toURI().toURL() );
-            }
-            catch ( MalformedURLException e )
-            {
-                throw new CheckstyleExecutorException( e.getMessage(), e );
-            }
-        }
-
-        for ( String outputDirectoryString : outputDirectories )
-        {
-            try
-            {
-                if ( outputDirectoryString != null )
-                {
-                    File outputDirectoryFile = new File( outputDirectoryString );
-                    if ( outputDirectoryFile.exists() )
-                    {
-                        URL outputDirectoryUrl = outputDirectoryFile.toURI().toURL();
-                        getLogger().debug( "Adding the outputDirectory " + outputDirectoryUrl.toString()
-                                               + " to the Checkstyle class path" );
-                        urls.add( outputDirectoryUrl );
-                    }
-                }
-            }
-            catch ( MalformedURLException e )
-            {
-                throw new CheckstyleExecutorException( e.getMessage(), e );
-            }
-        }
-
-        URLClassLoader projectClassLoader = AccessController.doPrivileged( new PrivilegedAction<URLClassLoader>()
-        {
-            public URLClassLoader run()
-            {
-                return new URLClassLoader( urls.toArray( new URL[0] ), null );
-            }
-        } );
-
-        /*
-         * MCHECKSTYLE-381: More recent Checkstyle versions will drop the setClassLoader() method.
-         * However, it was used before Checkstyle 8.25.
-         */
-        try
-        {
-            checker.setClassLoader( projectClassLoader );
-            /*
-             * MCHECKSTYLE-387: If the previous method call was successful, emit a warning that the user is using
-             * an old version of checkstyle.
-             */
-            getLogger().warn( "Old version of checkstyle detected. Consider updating to >= v8.30" );
-            getLogger().warn( "For more information see: "
-                + "https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html" );
-        }
-        catch ( NoSuchMethodError ignored )
-        {
-            /*
-             * The current checkstyle version does not support the method setClassLoader anymore.
-             * This is expected. The method call is being retained for less recent versions of checkstyle.
-             */
-        }
-
-    }
-
     protected void addSourceDirectory( CheckstyleCheckerListener sinkListener, Collection<File> sourceDirectories,
                                        Collection<File> testSourceDirectories, List<Resource> resources,
                                        CheckstyleExecutorRequest request )