[MJARSIGNER-56] Require Java 7
authorrfscholte <rfscholte@apache.org>
Fri, 26 Oct 2018 10:40:06 +0000 (12:40 +0200)
committerrfscholte <rfscholte@apache.org>
Fri, 26 Oct 2018 10:40:06 +0000 (12:40 +0200)
pom.xml
src/main/java/org/apache/maven/plugins/jarsigner/AbstractJarsignerMojo.java

diff --git a/pom.xml b/pom.xml
index ba6b27b..ce12704 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -72,6 +72,7 @@ under the License.
 
   <properties>
     <mavenVersion>3.0</mavenVersion>
+    <javaVersion>7</javaVersion>
   </properties>
 
   <dependencies>
index 69581d0..828bb2f 100644 (file)
@@ -292,22 +292,20 @@ public abstract class AbstractJarsignerMojo
 
                 if ( processAttachedArtifacts && !Boolean.FALSE.equals( attachments ) )
                 {
-                    Collection<String> includes = new HashSet<String>();
+                    Collection<String> includes = new HashSet<>();
                     if ( includeClassifiers != null )
                     {
                         includes.addAll( Arrays.asList( includeClassifiers ) );
                     }
 
-                    Collection<String> excludes = new HashSet<String>();
+                    Collection<String> excludes = new HashSet<>();
                     if ( excludeClassifiers != null )
                     {
                         excludes.addAll( Arrays.asList( excludeClassifiers ) );
                     }
 
-                    for ( Object o : this.project.getAttachedArtifacts() )
+                    for ( Artifact artifact : this.project.getAttachedArtifacts() )
                     {
-                        final Artifact artifact = (Artifact) o;
-
                         if ( !includes.isEmpty() && !includes.contains( artifact.getClassifier() ) )
                         {
                             continue;
@@ -510,7 +508,7 @@ public abstract class AbstractJarsignerMojo
         request.setProtectedAuthenticationPath( protectedAuthenticationPath );
 
         // Preserves 'file.encoding' the plugin is executed with.
-        final List<String> additionalArguments = new ArrayList<String>();
+        final List<String> additionalArguments = new ArrayList<>();
 
         boolean fileEncodingSeen = false;