FELIX-4707 : use Maven Plugin Tools Java 5 annotations instead of javadoc tags. Apply patch from Hervé Boutemy
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1665239 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/pom.xml b/bundleplugin/pom.xml
index 9b59cc1..10f82c5 100644
--- a/bundleplugin/pom.xml
+++ b/bundleplugin/pom.xml
@@ -46,6 +46,21 @@
</scm>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.4</version>
+ <executions>
+ <execution>
+ <id>default-descriptor</id>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -56,6 +71,10 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ <plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
@@ -124,6 +143,12 @@
<version>1.0</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.1</version>
@@ -136,7 +161,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
- <version>3.2</version>
+ <version>3.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
index 0274f0d..c3c1caa 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
@@ -26,6 +26,8 @@
import java.util.Properties;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
@@ -38,10 +40,8 @@
/**
* Generate Ant script to create the bundle (you should run ant:ant first).
*
- * @goal ant
- * @requiresDependencyResolution test
- * @description generate Ant script to create the bundle
*/
+@Mojo( name = "ant", requiresDependencyResolution = ResolutionScope.TEST )
public class AntPlugin extends BundlePlugin
{
static final String BUILD_XML = "/build.xml";
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java
index 17280e7..f6db406 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java
@@ -44,6 +44,12 @@
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.versioning.VersionRange;
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.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
@@ -58,15 +64,13 @@
/**
- * Create OSGi bundles from all dependencies in the Maven project
+ * Build an OSGi bundle jar for all transitive dependencies.
*
- * @goal bundleall
- * @phase package
- * @requiresDependencyResolution test
- * @description build an OSGi bundle jar for all transitive dependencies
* @deprecated The bundleall goal is no longer supported and may be removed in a future release
*/
@Deprecated
+@Mojo( name = "bundleall", requiresDependencyResolution = ResolutionScope.TEST )
+@Execute( phase = LifecyclePhase.PACKAGE )
public class BundleAllPlugin extends ManifestPlugin
{
private static final String LS = System.getProperty( "line.separator" );
@@ -75,76 +79,56 @@
/**
* Local repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
/**
* Remote repositories.
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true )
private List remoteRepositories;
/**
* Import-Package to be used when wrapping dependencies.
- *
- * @parameter expression="${wrapImportPackage}" default-value="*"
*/
+ @Parameter( property = "wrapImportPackage", defaultValue = "*" )
private String wrapImportPackage;
- /**
- * @component
- */
+ @Component
private ArtifactFactory m_factory;
- /**
- * @component
- */
+ @Component
private ArtifactMetadataSource m_artifactMetadataSource;
- /**
- * @component
- */
+ @Component
private ArtifactCollector m_collector;
/**
* Artifact resolver, needed to download jars.
- *
- * @component
*/
+ @Component
private ArtifactResolver m_artifactResolver;
- /**
- * @component
- */
+ @Component
private DependencyTreeBuilder m_dependencyTreeBuilder;
- /**
- * @component
- */
+ @Component
private MavenProjectBuilder m_mavenProjectBuilder;
/**
* Ignore missing artifacts that are not required by current project but are required by the
* transitive dependencies.
- *
- * @parameter
*/
+ @Parameter
private boolean ignoreMissingArtifacts;
private Set m_artifactsBeingProcessed = new HashSet();
/**
* Process up to some depth
- *
- * @parameter
*/
+ @Parameter
private int depth = Integer.MAX_VALUE;
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index c84973c..d964489 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -57,6 +57,12 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
+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.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
@@ -84,132 +90,105 @@
/**
* Create an OSGi bundle from Maven project
*
- * @goal bundle
- * @phase package
- * @requiresDependencyResolution test
- * @description build an OSGi bundle jar
- * @threadSafe
*/
+@Mojo( name = "bundle", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
+@Execute( phase = LifecyclePhase.PACKAGE )
public class BundlePlugin extends AbstractMojo
{
/**
* Directory where the manifest will be written
- *
- * @parameter expression="${manifestLocation}" default-value="${project.build.outputDirectory}/META-INF"
*/
+ @Parameter( property = "manifestLocation", defaultValue = "${project.build.outputDirectory}/META-INF" )
protected File manifestLocation;
/**
* Output a nicely formatted manifest that still respects the 72 character line limit.
- *
- * @parameter expression="${niceManifest}" default-value="false"
*/
+ @Parameter( property = "niceManifest", defaultValue = "false" )
protected boolean niceManifest;
/**
* File where the BND instructions will be dumped
- *
- * @parameter expression="${dumpInstructions}"
*/
+ @Parameter( property = "dumpInstructions" )
protected File dumpInstructions;
/**
* File where the BND class-path will be dumped
- *
- * @parameter expression="${dumpClasspath}"
*/
+ @Parameter( property = "dumpClasspath" )
protected File dumpClasspath;
/**
* When true, unpack the bundle contents to the outputDirectory
- *
- * @parameter expression="${unpackBundle}"
*/
+ @Parameter( property = "unpackBundle" )
protected boolean unpackBundle;
/**
* Comma separated list of artifactIds to exclude from the dependency classpath passed to BND (use "true" to exclude everything)
- *
- * @parameter expression="${excludeDependencies}"
*/
+ @Parameter( property = "excludeDependencies" )
protected String excludeDependencies;
/**
* Final name of the bundle (without classifier or extension)
- *
- * @parameter expression="${project.build.finalName}"
*/
+ @Parameter( defaultValue = "${project.build.finalName}")
private String finalName;
/**
* Classifier type of the bundle to be installed. For example, "jdk14".
* Defaults to none which means this is the project's main bundle.
- *
- * @parameter
*/
+ @Parameter
protected String classifier;
/**
* Packaging type of the bundle to be installed. For example, "jar".
* Defaults to none which means use the same packaging as the project.
- *
- * @parameter
*/
+ @Parameter
protected String packaging;
- /**
- * @component
- */
+ @Component
private MavenProjectHelper m_projectHelper;
- /**
- * @component
- */
+ @Component
private ArchiverManager m_archiverManager;
- /**
- * @component
- */
+ @Component
private ArtifactHandlerManager m_artifactHandlerManager;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
protected List<String> supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
/**
* The directory for the generated bundles.
- *
- * @parameter expression="${project.build.outputDirectory}"
- * @required
*/
+ @Parameter( defaultValue = "${project.build.outputDirectory}" )
private File outputDirectory;
/**
* The directory for the generated JAR.
- *
- * @parameter expression="${project.build.directory}"
- * @required
*/
+ @Parameter( defaultValue = "${project.build.directory}" )
private String buildDirectory;
/**
* The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${project}", readonly = true, required = true )
private MavenProject project;
/**
* The BND instructions for the bundle.
- *
- * @parameter
*/
+ @Parameter
private Map<String, String> instructions = new LinkedHashMap<String, String>();
/**
@@ -219,16 +198,11 @@
/**
* The archive configuration to use.
- *
- * @parameter
*/
+ @Parameter
private MavenArchiveConfiguration archive; // accessed indirectly in JarPluginConfiguration
- /**
- * @parameter default-value="${session}"
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${session}", readonly = true, required = true )
private MavenSession m_mavenSession;
private static final String MAVEN_SYMBOLICNAME = "maven-symbolicname";
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
index baf69d3..4341a3b 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
@@ -27,6 +27,8 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import aQute.bnd.osgi.Jar;
@@ -34,11 +36,8 @@
/**
* Generate BND instructions for this project
- *
- * @goal instructions
- * @requiresDependencyResolution test
- * @threadSafe
*/
+@Mojo( name = "instructions", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
public class InstructionsPlugin extends BundlePlugin
{
@Override
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
index de70107..9f365d4 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
@@ -33,6 +33,11 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+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.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import aQute.bnd.osgi.Analyzer;
@@ -43,19 +48,15 @@
/**
* Generate an OSGi manifest for this project
- *
- * @goal manifest
- * @phase process-classes
- * @requiresDependencyResolution test
- * @threadSafe
*/
+@Mojo( name = "manifest", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
+@Execute( phase = LifecyclePhase.PROCESS_CLASSES )
public class ManifestPlugin extends BundlePlugin
{
/**
* When true, generate the manifest by rebuilding the full bundle in memory
- *
- * @parameter expression="${rebuildBundle}"
*/
+ @Parameter( property = "rebuildBundle" )
protected boolean rebuildBundle;
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java
index 04c0f2b..021acef 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java
@@ -25,35 +25,30 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
import org.apache.maven.shared.osgi.Maven2OsgiConverter;
/**
- * Convert a group of versions to OSGi format.
- *
- * @goal cleanVersions
- * @description clean OSGi versions
- * @threadSafe
+ * Clean OSGi versions, ie convert a group of versions to OSGi format.
*/
+@Mojo( name = "cleanVersions", threadSafe = true )
public class VersionCleanerPlugin extends AbstractMojo
{
/**
* The BND instructions for the bundle.
- *
- * @parameter
*/
+ @Parameter
private Map<String, String> versions = new LinkedHashMap<String, String>();
/**
* The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${project}", readonly = true, required = true )
private MavenProject project;
private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter();
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/WrapPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/WrapPlugin.java
index 44975a3..8fe7e08 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/WrapPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/WrapPlugin.java
@@ -20,18 +20,19 @@
import org.apache.maven.plugin.MojoExecutionException;
+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.ResolutionScope;
/**
- * Create OSGi bundles from the direct dependencies of the Maven project.
- *
- * @goal wrap
- * @phase package
- * @requiresDependencyResolution test
- * @description build an OSGi bundle jar for direct dependencies
+ * Build an OSGi bundle jar for direct dependencies.
* @deprecated The wrap goal is no longer supported and may be removed in a future release
*/
@Deprecated
+@Mojo( name = "wrap", requiresDependencyResolution = ResolutionScope.TEST )
+@Execute( phase = LifecyclePhase.PACKAGE )
public final class WrapPlugin extends BundleAllPlugin
{
public void execute() throws MojoExecutionException
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/AbstractBaselinePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/AbstractBaselinePlugin.java
index 6d43198..2fa64e4 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/AbstractBaselinePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/AbstractBaselinePlugin.java
@@ -43,6 +43,8 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.StringUtils;
@@ -66,97 +68,66 @@
/**
* Flag to easily skip execution.
- *
- * @parameter expression="${baseline.skip}" default-value="false"
*/
+ @Parameter( property = "baseline.skip", defaultValue = "false" )
protected boolean skip;
/**
* Whether to fail on errors.
- *
- * @parameter expression="${baseline.failOnError}" default-value="true"
*/
+ @Parameter( property = "baseline.failOnError", defaultValue = "true" )
protected boolean failOnError;
/**
* Whether to fail on warnings.
- *
- * @parameter expression="${baseline.failOnWarning}" default-value="false"
*/
+ @Parameter( property = "baseline.failOnWarning", defaultValue = "false" )
protected boolean failOnWarning;
- /**
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${project}", readonly = true, required = true )
protected MavenProject project;
- /**
- * @parameter expression="${session}"
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${session}", readonly = true, required = true )
protected MavenSession session;
- /**
- * @parameter expression="${project.build.directory}"
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${project.build.directory}", readonly = true, required = true )
private File buildDirectory;
- /**
- * @parameter expression="${project.build.finalName}"
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${project.build.finalName}", readonly = true, required = true )
private String finalName;
- /**
- * @component
- */
+ @Component
protected ArtifactResolver resolver;
- /**
- * @component
- */
+ @Component
protected ArtifactFactory factory;
- /**
- * @component
- */
+ @Component
private ArtifactMetadataSource metadataSource;
/**
* Version to compare the current code against.
- *
- * @parameter expression="${comparisonVersion}" default-value="(,${project.version})"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "(,${project.version})", property="comparisonVersion" )
protected String comparisonVersion;
/**
* Classifier for the artifact to compare the current code against.
- *
- * @parameter expression="${comparisonClassifier}"
*/
+ @Parameter( property="comparisonClassifier" )
protected String comparisonClassifier;
/**
* A list of packages filter, if empty the whole bundle will be traversed. Values are specified in OSGi package
* instructions notation, e.g. <code>!org.apache.felix.bundleplugin</code>.
- *
- * @parameter
*/
+ @Parameter
private String[] filters;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
protected List<String> supportedProjectTypes = Arrays.asList( new String[] { "jar", "bundle" } );
public final void execute()
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselinePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselinePlugin.java
index 74219f2..224d1df 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselinePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselinePlugin.java
@@ -24,6 +24,11 @@
import java.util.Map;
import java.util.Map.Entry;
+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.plugins.annotations.ResolutionScope;
import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
import org.codehaus.plexus.util.xml.XMLWriter;
@@ -31,13 +36,10 @@
/**
* BND Baseline check between two bundles.
- *
- * @goal baseline
- * @phase verify
- * @requiresDependencyResolution test
- * @threadSafe true
* @since 2.4.1
*/
+@Mojo( name = "baseline", threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
+@Execute( phase = LifecyclePhase.VERIFY )
public final class BaselinePlugin
extends AbstractBaselinePlugin
{
@@ -46,16 +48,14 @@
/**
* An XML output file to render to <code>${project.build.directory}/baseline.xml</code>.
- *
- * @parameter expression="${project.build.directory}/baseline.xml"
*/
+ @Parameter(defaultValue="${project.build.directory}/baseline.xml")
private File xmlOutputFile;
/**
* Whether to log the results to the console or not, true by default.
- *
- * @parameter expression="${logResults}" default-value="true"
*/
+ @Parameter(defaultValue="true", property="logResults" )
private boolean logResults;
private static final class Context {
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java
index 72997ab..742d3fb 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java
@@ -28,6 +28,10 @@
import java.util.ResourceBundle;
import org.apache.maven.doxia.sink.Sink;
+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.reporting.MavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.codehaus.plexus.util.IOUtil;
@@ -37,11 +41,10 @@
/**
* BND Baseline report.
*
- * @goal baseline-report
- * @phase site
- * @threadSafe true
* @since 2.4.1
*/
+@Mojo( name = "baseline-report", threadSafe = true )
+@Execute( phase = LifecyclePhase.SITE )
public final class BaselineReport
extends AbstractBaselinePlugin
implements MavenReport
@@ -49,10 +52,8 @@
/**
* Specifies the directory where the report will be generated.
- *
- * @parameter default-value="${project.reporting.outputDirectory}"
- * @required
*/
+ @Parameter(defaultValue = "${project.reporting.outputDirectory}")
private File outputDirectory;
private static final class Context {
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/AbstractFileMojo.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/AbstractFileMojo.java
index 4869796..6686b21 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/AbstractFileMojo.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/AbstractFileMojo.java
@@ -25,6 +25,8 @@
import org.apache.maven.artifact.factory.ArtifactFactory;
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.Parameter;
import org.apache.maven.project.MavenProject;
@@ -37,65 +39,56 @@
{
/**
* GroupId of the bundle. Retrieved from POM file if specified.
- *
- * @parameter expression="${groupId}"
*/
+ @Parameter( property = "groupId" )
private String groupId;
/**
* ArtifactId of the bundle. Retrieved from POM file if specified.
- *
- * @parameter expression="${artifactId}"
*/
+ @Parameter( property = "artifactId" )
private String artifactId;
/**
* Version of the bundle. Retrieved from POM file if specified.
- *
- * @parameter expression="${version}"
*/
+ @Parameter( property = "version" )
private String version;
/**
* Packaging type of the bundle. Retrieved from POM file if specified.
- *
- * @parameter expression="${packaging}"
*/
+ @Parameter( property = "packaging" )
private String packaging;
/**
* Classifier type of the bundle. Defaults to none.
- *
- * @parameter expression="${classifier}"
*/
+ @Parameter( property = "classifier" )
private String classifier;
/**
* Location of an existing POM file.
- *
- * @parameter expression="${pomFile}"
*/
+ @Parameter( property = "pomFile" )
private File pomFile;
/**
* Bundle file, defaults to the artifact in the local Maven repository.
- *
- * @parameter expression="${file}"
*/
+ @Parameter( property = "file" )
protected File file;
/**
* Optional XML file describing additional requirements and capabilities.
- *
- * @parameter expression="${obrXml}"
*/
+ @Parameter( property = "obrXml" )
protected String obrXml;
/**
* Component factory for Maven artifacts
- *
- * @component
*/
+ @Component
private ArtifactFactory m_factory;
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
index 3c09d55..01b6d53 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
@@ -43,6 +43,10 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+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.codehaus.plexus.util.FileUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -54,28 +58,22 @@
/**
* Clean an OBR repository by finding and removing missing resources.
*
- * @requiresProject false
- * @goal clean
- * @phase clean
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "clean", requiresProject = false )
+@Execute( phase = LifecyclePhase.CLEAN )
public class ObrCleanRepo extends AbstractMojo
{
/**
* OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
index bd69d17..0451846 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
@@ -34,6 +34,11 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+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;
@@ -41,116 +46,89 @@
/**
* Deploys bundle details to a remote OBR repository (life-cycle goal)
*
- * @goal deploy
- * @phase deploy
- * @threadSafe
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "deploy", threadSafe = true )
+@Execute( phase = LifecyclePhase.DEPLOY )
public final class ObrDeploy extends AbstractMojo
{
/**
* When true, ignore remote locking.
- *
- * @parameter expression="${ignoreLock}"
*/
+ @Parameter( property = "ignoreLock" )
private boolean ignoreLock;
/**
* Optional public URL prefix for the remote repository.
- *
- * @parameter expression="${prefixUrl}"
*/
+ @Parameter( property = "prefixUrl" )
private String prefixUrl;
/**
* Optional public URL where the bundle has been deployed.
- *
- * @parameter expression="${bundleUrl}"
*/
+ @Parameter( property = "bundleUrl" )
private String bundleUrl;
/**
* Remote OBR Repository.
- *
- * @parameter expression="${remoteOBR}" default-value="NONE"
*/
+ @Parameter( property = "remoteOBR", defaultValue = "NONE" )
private String remoteOBR;
/**
* Local OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
private List supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
- /**
- * @parameter expression="${project.distributionManagementArtifactRepository}"
- * @readonly
- */
+ @Parameter( defaultValue = "${project.distributionManagementArtifactRepository}", readonly = true )
private ArtifactRepository deploymentRepository;
/**
* Alternative deployment repository. Format: id::layout::url
- *
- * @parameter expression="${altDeploymentRepository}"
*/
+ @Parameter( property = "altDeploymentRepository" )
private String altDeploymentRepository;
/**
* OBR specific deployment repository. Format: id::layout::url
- *
- * @parameter expression="${obrDeploymentRepository}"
*/
- private String obrDeploymentRepository;
+ @Parameter( property = "obrDeploymentRepository" )
+ private String obrDeploymentRepository;
/**
* Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
/**
* The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${project}", readonly = true, required = true )
private MavenProject project;
- /**
- * @parameter expression="${project.attachedArtifacts}
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${project.attachedArtifacts}", readonly = true, required = true )
private List attachedArtifacts;
/**
* Local Maven settings.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${settings}", readonly = true, required = true )
private Settings settings;
/**
* The Wagon manager.
- *
- * @component
*/
+ @Component
private WagonManager m_wagonManager;
/**
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
index 8a33c7a..0969042 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
@@ -28,6 +28,11 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+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;
@@ -35,89 +40,71 @@
/**
* Deploys bundle details to a remote OBR repository (command-line goal)
*
- * @requiresProject false
- * @goal deploy-file
- * @phase deploy
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "deploy-file", requiresProject = false )
+@Execute( phase = LifecyclePhase.DEPLOY )
public final class ObrDeployFile extends AbstractFileMojo
{
/**
* When true, ignore remote locking.
- *
- * @parameter expression="${ignoreLock}"
*/
+ @Parameter( property = "ignoreLock" )
private boolean ignoreLock;
/**
* Remote OBR Repository.
- *
- * @parameter expression="${remoteOBR}"
*/
+ @Parameter( property = "remoteOBR" )
private String remoteOBR;
/**
* Local OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
private List supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
/**
* Remote repository id, used to lookup authentication settings.
- *
- * @parameter expression="${repositoryId}" default-value="remote-repository"
- * @required
*/
+ @Parameter( property = "repositoryId", defaultValue = "remote-repository", required = true )
private String repositoryId;
/**
* Remote OBR repository URL, where the bundle details are to be uploaded.
- *
- * @parameter expression="${url}"
- * @required
*/
+ @Parameter( property = "url", required = true )
private String url;
/**
* Optional public URL where the bundle has been deployed.
- *
- * @parameter expression="${bundleUrl}"
*/
+ @Parameter( property = "bundleUrl" )
private String bundleUrl;
/**
* Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
/**
* Local Maven settings.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${settings}", readonly = true, required = true )
private Settings settings;
/**
* The Wagon manager.
- *
- * @component
*/
+ @Component
private WagonManager m_wagonManager;
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java
index 0b597b8..ef7100f 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java
@@ -38,47 +38,41 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
/**
* Index the content of a maven repository using OBR
*
- * @goal index
- * @requiresProject false
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "index", requiresProject = false )
public final class ObrIndex extends AbstractMojo
{
/**
* OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Template for urls
- *
- * @parameter expression="${urlTemplate}"
*/
+ @Parameter( property = "urlTemplate" )
private String urlTemplate;
/**
* The repository to index
- *
- * @parameter expression="${mavenRepository}
*/
+ @Parameter( property = "mavenRepository" )
private String mavenRepository;
/**
* Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
index d4b4003..219edbb 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
@@ -29,58 +29,48 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+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;
/**
* Installs bundle details in the local OBR repository (life-cycle goal)
*
- * @goal install
- * @phase install
- * @threadSafe
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "install", threadSafe = true )
+@Execute( phase = LifecyclePhase.INSTALL )
public final class ObrInstall extends AbstractMojo
{
/**
* OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
private List supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
/**
* Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
/**
* The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${project}", readonly = true, required = true )
private MavenProject project;
- /**
- * @parameter expression="${project.attachedArtifacts}
- * @required
- * @readonly
- */
+ @Parameter( defaultValue = "${project.attachedArtifacts}", readonly = true, required = true )
private List attachedArtifacts;
/**
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
index 92ca6e0..7a31c4b 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
@@ -26,42 +26,39 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+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;
/**
* Installs bundle details in the local OBR repository (command-line goal)
*
- * @requiresProject false
- * @goal install-file
- * @phase install
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "install-file", requiresProject = false )
+@Execute( phase = LifecyclePhase.INSTALL )
public final class ObrInstallFile extends AbstractFileMojo
{
/**
* OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
private List supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
/**
* Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
private ArtifactRepository localRepository;
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
index a326225..3bf7340 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
@@ -53,6 +53,11 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+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.w3c.dom.Document;
@@ -66,99 +71,77 @@
* Clean a remote repository file.
* It just looks for every resources and check that pointed file exists.
*
- * @requiresProject false
- * @goal remote-clean
- * @phase clean
- *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
+@Mojo( name = "remote-clean", requiresProject = false )
+@Execute( phase = LifecyclePhase.CLEAN )
public final class ObrRemoteClean extends AbstractMojo
{
/**
* When true, ignore remote locking.
- *
- * @parameter expression="${ignoreLock}"
*/
+ @Parameter( property = "ignoreLock" )
private boolean ignoreLock;
/**
* Optional public URL prefix for the remote repository.
- *
- * @parameter expression="${prefixUrl}"
*/
+ @Parameter( property = "prefixUrl" )
private String prefixUrl;
/**
* Remote OBR Repository.
- *
- * @parameter expression="${remoteOBR}" default-value="NONE"
*/
+ @Parameter( property = "remoteOBR", defaultValue = "NONE" )
private String remoteOBR;
/**
* Local OBR Repository.
- *
- * @parameter expression="${obrRepository}"
*/
+ @Parameter( property = "obrRepository" )
private String obrRepository;
/**
* Project types which this plugin supports.
- *
- * @parameter
*/
+ @Parameter
private List supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
- /**
- * @parameter expression="${project.distributionManagementArtifactRepository}"
- * @readonly
- */
+ @Parameter( defaultValue = "${project.distributionManagementArtifactRepository}", readonly = true )
private ArtifactRepository deploymentRepository;
/**
* Alternative deployment repository. Format: id::layout::url
- *
- * @parameter expression="${altDeploymentRepository}"
*/
+ @Parameter( property = "altDeploymentRepository" )
private String altDeploymentRepository;
/**
* OBR specific deployment repository. Format: id::layout::url
- *
- * @parameter expression="${obrDeploymentRepository}"
*/
+ @Parameter( property = "obrDeploymentRepository" )
private String obrDeploymentRepository;
- /**
- * @parameter default-value="${settings.interactiveMode}"
- * @readonly
- */
+ @Parameter( defaultValue = "${settings.interactiveMode}", readonly = true )
private boolean interactive;
/**
* The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${project}", readonly = true, required = true )
private MavenProject project;
/**
* Local Maven settings.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
*/
+ @Parameter( defaultValue = "${settings}", readonly = true, required = true )
private Settings settings;
/**
* The Wagon manager.
- *
- * @component
*/
+ @Component
private WagonManager m_wagonManager;