[MGPG-52] Upgrade to maven-plugins parent version 27
- Cleaned up pom to let the parent do it's work.
- Fixed checkstyle reported issues.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1640444 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index ab60ab2..267a2a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
- <version>25</version>
+ <version>27</version>
<relativePath>../maven-plugins/pom.xml</relativePath>
</parent>
@@ -58,7 +58,6 @@
<properties>
<mavenVersion>2.2.1</mavenVersion>
- <mavenPluginPluginVersion>3.2</mavenPluginPluginVersion>
</properties>
<dependencies>
@@ -71,12 +70,6 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${mavenVersion}</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -96,7 +89,6 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
- <version>${mavenPluginPluginVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -106,38 +98,6 @@
</dependency>
</dependencies>
- <build>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>${mavenPluginPluginVersion}</version>
- <configuration>
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <configuration>
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- </configuration>
- <executions>
- <execution>
- <id>generate-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<profiles>
<profile>
<id>run-its</id>
@@ -187,7 +147,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
- <version>1.5</version>
</plugin>
</plugins>
</reporting>
diff --git a/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgMojo.java b/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgMojo.java
index 7bb04ed..35e3f84 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgMojo.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgMojo.java
@@ -62,12 +62,12 @@
* optional as the agent will provide it.
* For gpg2, specify true as --no-use-agent was removed in gpg2 and doesn't ask for a passphrase anymore.
*/
- @Parameter( property = "gpg.useagent", defaultValue = "true")
+ @Parameter( property = "gpg.useagent", defaultValue = "true" )
private boolean useAgent;
/**
*/
- @Parameter( defaultValue = "${settings.interactiveMode}", readonly = true)
+ @Parameter( defaultValue = "${settings.interactiveMode}", readonly = true )
private boolean interactive;
/**
@@ -113,8 +113,8 @@
* {@code multiple} and {@code never}. The lock mode gets translated into the corresponding {@code --lock-___}
* command line argument. Improper usage of this option may lead to data and key corruption.
*
- * @see <a href="http://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html">the --lock-*
- * options</a>
+ * @see <a href="http://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html">the
+ * --lock-options</a>
* @since 1.5
*/
@Parameter( property = "gpg.lockMode" )
@@ -122,12 +122,14 @@
/**
* Sets the arguments to be passed to gpg. Example:
+ *
* <pre>
* <gpgArguments>
* <arg>--no-random-seed-file</arg>
* <arg>--no-permission-warning</arg>
* </gpgArguments>
* </pre>
+ *
* @since 1.5
*/
@Parameter
diff --git a/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgSigner.java b/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgSigner.java
index a67cc34..49286f1 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgSigner.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/AbstractGpgSigner.java
@@ -254,9 +254,12 @@
private String readPassword( String prompt )
throws IOException
{
- try {
+ try
+ {
return readPasswordJava16( prompt );
- } catch ( IOException e ) {
+ }
+ catch ( IOException e )
+ {
throw e;
}
catch ( NoSuchMethodException e )
diff --git a/src/main/java/org/apache/maven/plugin/gpg/AscArtifactMetadata.java b/src/main/java/org/apache/maven/plugin/gpg/AscArtifactMetadata.java
index ae179e4..5523769 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/AscArtifactMetadata.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/AscArtifactMetadata.java
@@ -29,6 +29,10 @@
import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException;
import org.codehaus.plexus.util.FileUtils;
+/**
+ * @author dkulp
+ *
+ */
public class AscArtifactMetadata
extends AbstractArtifactMetadata
{
diff --git a/src/main/java/org/apache/maven/plugin/gpg/AttachedSignedArtifact.java b/src/main/java/org/apache/maven/plugin/gpg/AttachedSignedArtifact.java
index 42c0df9..3a4d431 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/AttachedSignedArtifact.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/AttachedSignedArtifact.java
@@ -295,7 +295,7 @@
for ( Iterator i = result.iterator(); i.hasNext() && !alreadySigned; )
{
ArtifactMetadata metadata = (ArtifactMetadata) i.next();
- alreadySigned = signature.getKey().equals(metadata.getKey());
+ alreadySigned = signature.getKey().equals( metadata.getKey() );
}
if ( !alreadySigned )
{
diff --git a/src/main/java/org/apache/maven/plugin/gpg/GpgSignAttachedMojo.java b/src/main/java/org/apache/maven/plugin/gpg/GpgSignAttachedMojo.java
index fc60121..eccc716 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/GpgSignAttachedMojo.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/GpgSignAttachedMojo.java
@@ -48,7 +48,7 @@
extends AbstractGpgMojo
{
- private static final String DEFAULT_EXCLUDES[] = new String[]{ "**/*.md5", "**/*.sha1", "**/*.asc" };
+ private static final String DEFAULT_EXCLUDES[] = new String[] { "**/*.md5", "**/*.sha1", "**/*.asc" };
/**
* Skip doing the gpg signing.
@@ -184,18 +184,20 @@
// Attached artifacts
// ----------------------------------------------------------------------------
- for (Object o : project.getAttachedArtifacts()) {
+ for ( Object o : project.getAttachedArtifacts() )
+ {
Artifact artifact = (Artifact) o;
File file = artifact.getFile();
- getLog().debug("Generating signature for " + file);
+ getLog().debug( "Generating signature for " + file );
- File signature = signer.generateSignatureForArtifact(file);
+ File signature = signer.generateSignatureForArtifact( file );
- if (signature != null) {
- signingBundles.add(new SigningBundle(artifact.getArtifactHandler().getExtension(),
- artifact.getClassifier(), signature));
+ if ( signature != null )
+ {
+ signingBundles.add( new SigningBundle( artifact.getArtifactHandler().getExtension(),
+ artifact.getClassifier(), signature ) );
}
}
@@ -203,11 +205,12 @@
// Attach all the signatures
// ----------------------------------------------------------------------------
- for (Object signingBundle : signingBundles) {
+ for ( Object signingBundle : signingBundles )
+ {
SigningBundle bundle = (SigningBundle) signingBundle;
- projectHelper.attachArtifact(project, bundle.getExtension() + GpgSigner.SIGNATURE_EXTENSION,
- bundle.getClassifier(), bundle.getSignature());
+ projectHelper.attachArtifact( project, bundle.getExtension() + GpgSigner.SIGNATURE_EXTENSION,
+ bundle.getClassifier(), bundle.getSignature() );
}
}
@@ -220,8 +223,10 @@
*/
protected boolean isExcluded( String name )
{
- for (String exclude : excludes) {
- if (SelectorUtils.matchPath(exclude, name)) {
+ for ( String exclude : excludes )
+ {
+ if ( SelectorUtils.matchPath( exclude, name ) )
+ {
return true;
}
}
diff --git a/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java b/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
index 862ba4e..39d5d83 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
@@ -22,7 +22,6 @@
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
-import java.util.Iterator;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.plexus.util.Os;
diff --git a/src/main/java/org/apache/maven/plugin/gpg/SignAndDeployFileMojo.java b/src/main/java/org/apache/maven/plugin/gpg/SignAndDeployFileMojo.java
index 028ad37..6739dff 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/SignAndDeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/SignAndDeployFileMojo.java
@@ -388,13 +388,13 @@
int classifiersLength = StringUtils.countMatches( classifiers, "," );
if ( typesLength != filesLength )
{
- throw new MojoExecutionException( "You must specify the same number of entries in 'files' and " +
- "'types' (respectively " + filesLength + " and " + typesLength + " entries )" );
+ throw new MojoExecutionException( "You must specify the same number of entries in 'files' and "
+ + "'types' (respectively " + filesLength + " and " + typesLength + " entries )" );
}
if ( classifiersLength != filesLength )
{
- throw new MojoExecutionException( "You must specify the same number of entries in 'files' and " +
- "'classifiers' (respectively " + filesLength + " and " + classifiersLength + " entries )" );
+ throw new MojoExecutionException( "You must specify the same number of entries in 'files' and "
+ + "'classifiers' (respectively " + filesLength + " and " + classifiersLength + " entries )" );
}
int fi = 0;
int ti = 0;
@@ -423,16 +423,16 @@
file = new File( project.getBasedir(), files.substring( fi, nfi ) );
}
if ( file.isFile() )
- {
+ {
if ( StringUtils.isWhitespace( classifiers.substring( ci, nci ) ) )
{
projectHelper.attachArtifact( project, types.substring( ti, nti ).trim(), file );
}
else
{
- projectHelper.attachArtifact( project, types.substring( ti, nti).trim(),
- classifiers.substring( ci, nci ).trim(), file);
- }
+ projectHelper.attachArtifact( project, types.substring( ti, nti ).trim(),
+ classifiers.substring( ci, nci ).trim(), file );
+ }
}
else
{
@@ -442,31 +442,35 @@
ti = nti + 1;
ci = nci + 1;
}
- }
- else
- {
+ }
+ else
+ {
if ( types != null )
{
throw new MojoExecutionException( "You must specify 'files' if you specify 'types'" );
- }
+ }
if ( classifiers != null )
- {
+ {
throw new MojoExecutionException( "You must specify 'files' if you specify 'classifiers'" );
- }
- }
+ }
+ }
List attachedArtifacts = project.getAttachedArtifacts();
- for (Object attachedArtifact : attachedArtifacts) {
+ for ( Object attachedArtifact : attachedArtifacts )
+ {
Artifact attached = (Artifact) attachedArtifact;
- fileSig = signer.generateSignatureForArtifact(attached.getFile());
- attached = new AttachedSignedArtifact(attached, new AscArtifactMetadata(attached, fileSig, false));
- try {
- deploy(attached.getFile(), attached, deploymentRepository, localRepository);
- } catch (ArtifactDeploymentException e) {
- throw new MojoExecutionException(
- "Error deploying attached artifact " + attached.getFile() + ": " + e.getMessage(), e);
+ fileSig = signer.generateSignatureForArtifact( attached.getFile() );
+ attached = new AttachedSignedArtifact( attached, new AscArtifactMetadata( attached, fileSig, false ) );
+ try
+ {
+ deploy( attached.getFile(), attached, deploymentRepository, localRepository );
+ }
+ catch ( ArtifactDeploymentException e )
+ {
+ throw new MojoExecutionException( "Error deploying attached artifact " + attached.getFile() + ": "
+ + e.getMessage(), e );
}
}
@@ -645,23 +649,26 @@
{
try
{
- if (count > 0)
+ if ( count > 0 )
{
- getLog().info(
- "Retrying deployment attempt " + ( count + 1 ) + " of " + retryFailedDeploymentCount );
+ // CHECKSTYLE_OFF: LineLength
+ getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of " + retryFailedDeploymentCount );
+ // CHECKSTYLE_ON: LineLength
}
deployer.deploy( source, artifact, deploymentRepository, localRepository );
- for (Object o : artifact.getMetadataList()) {
+ for ( Object o : artifact.getMetadataList() )
+ {
ArtifactMetadata metadata = (ArtifactMetadata) o;
- getLog().info("Metadata[" + metadata.getKey() + "].filename = " + metadata.getRemoteFilename());
+ getLog().info( "Metadata[" + metadata.getKey() + "].filename = " + metadata.getRemoteFilename() );
}
exception = null;
break;
}
catch ( ArtifactDeploymentException e )
{
- if (count + 1 < retryFailedDeploymentCount) {
- getLog().warn( "Encountered issue during deployment: " + e.getLocalizedMessage());
+ if ( count + 1 < retryFailedDeploymentCount )
+ {
+ getLog().warn( "Encountered issue during deployment: " + e.getLocalizedMessage() );
getLog().debug( e );
}
if ( exception == null )