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/29 13:40:17 UTC

[maven] branch checkstyle-next created (now e33e0ec)

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

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


      at e33e0ec  Validate also with latest Checkstyle 8.38

This branch includes the following new commits:

     new 619ccfe  Fix Checkstyle reported issues with new maven-shared-resources form
     new e33e0ec  Validate also with latest Checkstyle 8.38

The 2 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.



[maven] 01/02: Fix Checkstyle reported issues with new maven-shared-resources form

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

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

commit 619ccfef6b84c762d25424da2505ca0b40f68fe6
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Dec 29 14:39:00 2020 +0100

    Fix Checkstyle reported issues with new maven-shared-resources form
---
 .../artifact/repository/ArtifactRepositoryPolicy.java   |  4 ++--
 .../apache/maven/execution/BuildResumptionAnalyzer.java |  2 +-
 .../maven/execution/BuildResumptionDataRepository.java  |  6 +++---
 .../project/collector/ProjectCollectionStrategy.java    |  2 +-
 .../model/building/DefaultBuildPomXMLFilterFactory.java |  2 +-
 pom.xml                                                 | 17 +++++++++++++++++
 6 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java
index 6ad2a26..72fe58e 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java
@@ -21,6 +21,7 @@ package org.apache.maven.artifact.repository;
 
 import java.util.Calendar;
 import java.util.Date;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Describes a set of policies for a repository to use under certain conditions.
@@ -200,12 +201,11 @@ public class ArtifactRepositoryPolicy
         }
     }
 
-    @SuppressWarnings( "checkstyle:magicnumber" )
     private int ordinalOfUpdatePolicy( String policy )
     {
         if ( ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY.equals( policy ) )
         {
-            return 1440;
+            return (int) TimeUnit.DAYS.toMinutes( 1 );
         }
         else if ( ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( policy ) )
         {
diff --git a/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionAnalyzer.java b/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionAnalyzer.java
index 1778946..fa3db8a 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionAnalyzer.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionAnalyzer.java
@@ -32,5 +32,5 @@ public interface BuildResumptionAnalyzer
      * @param result Outcome of the current Maven build.
      * @return A {@link BuildResumptionData} instance or {@link Optional#empty()} if resuming the build is not possible.
      */
-    Optional<BuildResumptionData> determineBuildResumptionData( final MavenExecutionResult result );
+    Optional<BuildResumptionData> determineBuildResumptionData( MavenExecutionResult result );
 }
diff --git a/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionDataRepository.java b/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionDataRepository.java
index 3d0be6f..36453f6 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionDataRepository.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionDataRepository.java
@@ -37,7 +37,7 @@ public interface BuildResumptionDataRepository
      * @param buildResumptionData Information needed to resume the build.
      * @throws BuildResumptionPersistenceException When an error occurs while persisting data.
      */
-    void persistResumptionData( final MavenProject rootProject, final BuildResumptionData buildResumptionData )
+    void persistResumptionData( MavenProject rootProject, BuildResumptionData buildResumptionData )
             throws BuildResumptionPersistenceException;
 
     /**
@@ -45,12 +45,12 @@ public interface BuildResumptionDataRepository
      * @param request The execution request that will be enriched.
      * @param rootProject The root project that is being built.
      */
-    void applyResumptionData( final MavenExecutionRequest request, final MavenProject rootProject );
+    void applyResumptionData( MavenExecutionRequest request, MavenProject rootProject );
 
     /**
      * Removes previously stored resumption data.
      * @param rootProject The root project that is being built.
      */
-    void removeResumptionData( final MavenProject rootProject );
+    void removeResumptionData( MavenProject rootProject );
 
 }
diff --git a/maven-core/src/main/java/org/apache/maven/project/collector/ProjectCollectionStrategy.java b/maven-core/src/main/java/org/apache/maven/project/collector/ProjectCollectionStrategy.java
index e1931fe..53521f0 100644
--- a/maven-core/src/main/java/org/apache/maven/project/collector/ProjectCollectionStrategy.java
+++ b/maven-core/src/main/java/org/apache/maven/project/collector/ProjectCollectionStrategy.java
@@ -36,6 +36,6 @@ public interface ProjectCollectionStrategy
      * @return
      * @throws ProjectBuildingException
      */
-    List<MavenProject> collectProjects( final MavenExecutionRequest request )
+    List<MavenProject> collectProjects( MavenExecutionRequest request )
             throws ProjectBuildingException;
 }
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java
index 04e4fcf..60f5ca6 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultBuildPomXMLFilterFactory.java
@@ -64,7 +64,7 @@ public class DefaultBuildPomXMLFilterFactory extends BuildPomXMLFilterFactory
     @Override
     protected BiFunction<String, String, String> getDependencyKeyToVersionMapper()
     {
-        return (g, a) -> Optional.ofNullable( context.getRawModel( g, a ) )
+        return ( g, a ) -> Optional.ofNullable( context.getRawModel( g, a ) )
                             .map( m -> toVersion( m ) )
                             .orElse( null );
     }
diff --git a/pom.xml b/pom.xml
index 23f976f..b5480c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -480,6 +480,23 @@ under the License.
     <pluginManagement>
       <plugins>
         <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <version>3.1.1</version>
+          <dependencies>
+            <dependency>
+              <groupId>com.puppycrawl.tools</groupId>
+              <artifactId>checkstyle</artifactId>
+              <version>8.29</version>
+            </dependency>
+            <dependency>
+              <groupId>org.apache.maven.shared</groupId>
+              <artifactId>maven-shared-resources</artifactId>
+              <version>3-SNAPSHOT</version>
+            </dependency>
+          </dependencies>
+        </plugin>
+        <plugin>
           <groupId>org.codehaus.plexus</groupId>
           <artifactId>plexus-component-metadata</artifactId>
           <version>${plexusVersion}</version>


[maven] 02/02: Validate also with latest Checkstyle 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 checkstyle-next
in repository https://gitbox.apache.org/repos/asf/maven.git

commit e33e0ec7a3103bc7258528a0bb3e986293c8ce99
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Dec 29 14:40:00 2020 +0100

    Validate also with latest Checkstyle 8.38
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b5480c0..15f473d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -487,7 +487,7 @@ under the License.
             <dependency>
               <groupId>com.puppycrawl.tools</groupId>
               <artifactId>checkstyle</artifactId>
-              <version>8.29</version>
+              <version>8.38</version>
             </dependency>
             <dependency>
               <groupId>org.apache.maven.shared</groupId>