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

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

commit 7343144b4e20404faa321d3840897fbc5098c815
Author: Sylwester Lachiewicz <slachiew...@apache.org>
AuthorDate: Wed May 5 20:01:24 2021 +0200

    mvn 3.1.1
---
 pom.xml                                            | 16 +--------------
 .../maven/plugins/gpg/SignAndDeployFileMojo.java   | 23 ++++++++++++----------
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6cf4e98..16b3ab3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,7 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <mavenVersion>3.0</mavenVersion>
+    <mavenVersion>3.1.1</mavenVersion>
     <javaVersion>7</javaVersion>
     
<project.build.outputTimestamp>2021-05-05T16:39:01Z</project.build.outputTimestamp>
     <resource.delimiter>@</resource.delimiter>
@@ -117,13 +117,6 @@ under the License.
       <optional>true</optional>
     </dependency>
     <dependency>
-      <!-- org.sonatype.aether.util.artifact.SubArtifact -->
-      <groupId>org.sonatype.aether</groupId>
-      <artifactId>aether-util</artifactId>
-      <version>1.13.1</version>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
       <version>3.3.0</version>
@@ -201,7 +194,6 @@ under the License.
               <artifactSet>
                 <includes>
                   
<include>org.apache.maven.resolver:maven-resolver-util</include>
-                  <include>org.sonatype.aether:aether-util</include>
                 </includes>
               </artifactSet>
               <filters>
@@ -211,12 +203,6 @@ under the License.
                     
<include>org/eclipse/aether/util/artifact/SubArtifact.class</include>
                   </includes>
                 </filter>
-                <filter>
-                  <artifact>org.sonatype.aether:aether-util</artifact>
-                  <includes>
-                    
<include>org/sonatype/aether/util/artifact/SubArtifact.class</include>
-                  </includes>
-                </filter>
               </filters>
             </configuration>
           </execution>
diff --git 
a/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java 
b/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java
index b7bc314..991d2b8 100644
--- a/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java
@@ -36,14 +36,13 @@ import 
org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.artifact.repository.MavenArtifactRepository;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.execution.MavenSession;
-import org.apache.maven.model.InputLocation;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Parent;
 import org.apache.maven.model.building.DefaultModelBuildingRequest;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.ModelProblem;
-import org.apache.maven.model.building.ModelProblem.Severity;
 import org.apache.maven.model.building.ModelProblemCollector;
+import org.apache.maven.model.building.ModelProblemCollectorRequest;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
 import org.apache.maven.model.validation.ModelValidator;
@@ -585,7 +584,7 @@ public class SignAndDeployFileMojo
                     
         List<String> result = new ArrayList<>();
 
-        SimpleModelProblemCollector problemCollector = new 
SimpleModelProblemCollector( result );
+        ModelProblemCollector problemCollector = new 
SimpleModelProblemCollector( result );
 
         modelValidator.validateEffectiveModel( model, request, 
problemCollector );
 
@@ -594,7 +593,7 @@ public class SignAndDeployFileMojo
             StringBuilder msg = new StringBuilder( "The artifact information 
is incomplete or not valid:\n" );
             for ( String e : result )
             {
-                msg.append( " - " + e + '\n' );
+                msg.append( " - " ).append( e ).append( '\n' );
             }
             throw new MojoFailureException( msg.toString() );
         }
@@ -648,9 +647,8 @@ public class SignAndDeployFileMojo
                 }
                 deployer.deploy( buildingRequest, deploymentRepository, 
Collections.singletonList( artifact ) );
 
-                for ( Object o : artifact.getMetadataList() )
+                for ( ArtifactMetadata metadata : artifact.getMetadataList() )
                 {
-                    ArtifactMetadata metadata = (ArtifactMetadata) o;
                     getLog().info( "Metadata[" + metadata.getKey() + 
"].filename = " + metadata.getRemoteFilename() );
                 }
                 exception = null;
@@ -692,13 +690,18 @@ public class SignAndDeployFileMojo
             this.result = result;
         }
 
-        public void add( Severity severity, String message, InputLocation 
location, Exception cause )
+        /**
+         * Adds the specified problem.
+         *
+         * @param req must not be null
+         */
+        @Override
+        public void add( ModelProblemCollectorRequest req )
         {
-            if ( !ModelProblem.Severity.WARNING.equals( severity ) )
+            if ( !req.getSeverity().equals( ModelProblem.Severity.WARNING ) )
             {
-                result.add( message );
+                result.add( req.getMessage() );
             }
         }
-
     }
 }

Reply via email to