You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by tc...@apache.org on 2012/07/11 14:52:09 UTC
svn commit: r1360155 - in /maven/plugins/trunk/maven-repository-plugin:
pom.xml
src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java
src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java
Author: tchemit
Date: Wed Jul 11 12:52:09 2012
New Revision: 1360155
URL: http://svn.apache.org/viewvc?rev=1360155&view=rev
Log:
[MREPOSITORY-26] use maven-plugin-tools' java 5 annotations
Modified:
maven/plugins/trunk/maven-repository-plugin/pom.xml
maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java
maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java
Modified: maven/plugins/trunk/maven-repository-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/pom.xml?rev=1360155&r1=1360154&r2=1360155&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-repository-plugin/pom.xml Wed Jul 11 12:52:09 2012
@@ -102,6 +102,11 @@ under the License.
<version>${mavenVersion}</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.0-beta-1</version>
@@ -157,6 +162,13 @@ under the License.
<pluginManagement>
<plugins>
<plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
@@ -171,6 +183,20 @@ under the License.
</plugin>
</plugins>
</pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
<profiles>
Modified: maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java?rev=1360155&r1=1360154&r2=1360155&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java Wed Jul 11 12:52:09 2012
@@ -21,8 +21,14 @@ package org.apache.maven.plugins.reposit
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Execute;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
+import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.components.interactivity.InputHandler;
import org.codehaus.plexus.util.StringUtils;
@@ -34,10 +40,10 @@ import java.util.List;
/**
* Goal which creates an upload bundle for a project built with Maven.
*
- * @goal bundle-create
- * @execute phase="package"
* @since 2.0
*/
+@Mojo( name = "bundle-create" )
+@Execute( phase = LifecyclePhase.PACKAGE )
public class BundleCreateMojo
extends AbstractMojo
{
@@ -45,44 +51,38 @@ public class BundleCreateMojo
/**
* Output directory.
- *
- * @parameter default-value="${project.build.directory}"
- * @readonly
*/
+ @Parameter( defaultValue = "${project.build.directory}", readonly = true )
private File outputDirectory;
/**
* The current Maven project.
- *
- * @parameter default-value="${project}"
- * @readonly
*/
+ @Component
private MavenProject project;
-
+
/**
* Disable validations to make sure bundle supports project materialization.
* <br/>
* <b>WARNING: This means your project will be MUCH harder to use.</b>
- * @parameter expression="${bundle.disableMaterialization}" default-value="false"
*/
+ @Parameter( property = "bundle.disableMaterialization", defaultValue = "false" )
private boolean disableMaterialization;
/**
* Jar archiver.
- *
- * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
*/
+ @Component( role = Archiver.class, hint = "jar" )
private JarArchiver jarArchiver;
/**
- * @component
*/
+ @Component
protected InputHandler inputHandler;
-
+
/**
- * @parameter default-value="${settings}"
- * @readonly
*/
+ @Component
protected Settings settings;
public void execute()
Modified: maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java?rev=1360155&r1=1360154&r2=1360155&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundlePackMojo.java Wed Jul 11 12:52:09 2012
@@ -32,7 +32,11 @@ import org.apache.maven.model.io.xpp3.Ma
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.settings.Settings;
+import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.components.interactivity.InputHandler;
@@ -53,10 +57,9 @@ import java.util.List;
* missing values. Can be used to generate bundles for third parties artifacts
* that have been manually added to the local repository.
*
- * @goal bundle-pack
- * @requiresProject false
* @since 2.1
*/
+@Mojo( name = "bundle-pack", requiresProject = false )
public class BundlePackMojo
extends AbstractMojo
{
@@ -64,97 +67,84 @@ public class BundlePackMojo
/**
* Jar archiver.
- *
- * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
*/
+ @Component( role = Archiver.class, hint = "jar" )
protected JarArchiver jarArchiver;
/**
* Artifact resolver.
- *
- * @component
*/
+ @Component
protected ArtifactResolver artifactResolver;
/**
* Artifact factory.
- *
- * @component
*/
+ @Component
protected ArtifactFactory artifactFactory;
/**
* Local maven repository.
- *
- * @parameter default-value="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
protected ArtifactRepository localRepository;
/**
- * @component
*/
+ @Component
protected InputHandler inputHandler;
/**
* Directory where the upload-bundle will be created.
- *
- * @parameter default-value="${basedir}"
- * @readonly
*/
+ @Parameter( defaultValue = "${basedir}", readonly = true )
protected String basedir;
/**
* GroupId for the artifact to create an upload bundle for.
- *
- * @parameter expression="${groupId}"
*/
+ @Parameter( property = "groupId" )
protected String groupId;
/**
* ArtifactId for the artifact to create an upload bundle for.
- *
- * @parameter expression="${artifactId}"
*/
+ @Parameter( property = "artifactId" )
protected String artifactId;
/**
* Version for the artifact to create an upload bundle for.
- *
- * @parameter expression="${version}"
*/
+ @Parameter( property = "version" )
protected String version;
-
+
/**
* Viewable URL for SCM connections, in cases where this isn't provided by the POM.
- * @parameter expression="${scmUrl}"
*/
+ @Parameter( property = "scmUrl" )
protected String scmUrl;
-
+
/**
* Read-only URL for SCM tool connections, in cases where this isn't provided by the POM.
* <br/>
- * <b>NOTE:</b> This should be a standard maven-scm URL. See the
- * <a href="http://maven.apache.org/scm/scm-url-format.html">format guidelines</a> for more
+ * <b>NOTE:</b> This should be a standard maven-scm URL. See the
+ * <a href="http://maven.apache.org/scm/scm-url-format.html">format guidelines</a> for more
* information.
- *
- * @parameter expression="${scmConnection}"
*/
+ @Parameter( property = "scmConnection" )
protected String scmConnection;
-
+
/**
- * @parameter default-value="${settings}"
- * @readonly
*/
+ @Component
protected Settings settings;
/**
* Disable validations to make sure bundle supports project materialization.
* <br/>
* <b>WARNING: This means your project will be MUCH harder to use.</b>
- * @parameter expression="${bundle.disableMaterialization}" default-value="false"
*/
+ @Parameter( property = "bundle.disableMaterialization", defaultValue = "false" )
private boolean disableMaterialization;
@SuppressWarnings( "unchecked" )