r2409 - in trunk: . nuiton-utils-maven-report-plugin nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report
Author: tchemit Date: 2012-09-02 18:36:14 +0200 (Sun, 02 Sep 2012) New Revision: 2409 Url: http://nuiton.org/repositories/revision/nuiton-utils/2409 Log: fixes #2294: Use m-plugin-p 3 new api (annotations) fixes #2295: Aggreagate application-config report should fork to compile modules Modified: trunk/nuiton-utils-maven-report-plugin/pom.xml trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AbstractApplicationConfigReport.java trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AggregateApplicationConfigReport.java trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/ApplicationConfigReport.java trunk/pom.xml Modified: trunk/nuiton-utils-maven-report-plugin/pom.xml =================================================================== --- trunk/nuiton-utils-maven-report-plugin/pom.xml 2012-08-30 14:43:50 UTC (rev 2408) +++ trunk/nuiton-utils-maven-report-plugin/pom.xml 2012-09-02 16:36:14 UTC (rev 2409) @@ -71,6 +71,11 @@ </dependency> <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + </dependency> + + <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-api</artifactId> </dependency> @@ -146,6 +151,25 @@ <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <configuration> + <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> + </configuration> + <executions> + <execution> + <goals> + <goal>helpmojo</goal> + <goal>descriptor</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> @@ -164,10 +188,6 @@ </executions> </plugin> - <plugin> - <artifactId>maven-plugin-plugin</artifactId> - </plugin> - </plugins> </build> Modified: trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AbstractApplicationConfigReport.java =================================================================== --- trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AbstractApplicationConfigReport.java 2012-08-30 14:43:50 UTC (rev 2408) +++ trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AbstractApplicationConfigReport.java 2012-09-02 16:36:14 UTC (rev 2409) @@ -24,6 +24,8 @@ package org.nuiton.util.plugin.report; import org.apache.maven.doxia.siterenderer.Renderer; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.MavenReportException; @@ -58,10 +60,11 @@ * from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output * directory configured in the Maven Site Plugin is used instead. * - * @parameter property="config.outputDirectory" default-value="${project.reporting.outputDirectory}" - * @required * @since 2.4.8 */ + @Parameter(property = "config.outputDirectory", + defaultValue = "${project.reporting.outputDirectory}", + required = true) private File outputDirectory; /** @@ -69,10 +72,11 @@ * from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output * encoding configured in the Maven Site Plugin is used instead. * - * @parameter property="config.outputEncoding" default-value="${project.reporting.outputEncoding}" - * @required * @since 2.4.8 */ + @Parameter(property = "config.outputEncoding", + defaultValue = "${project.reporting.outputEncoding}", + required = true) private String outputEncoding; /** @@ -83,19 +87,20 @@ * could be costy if many dependencies), otherwise will init I18n system * usinga {@link DefaultI18nInitializer} with this bundle name. * - * @parameter property="config.i18nBundleName" * @since 2.4.8 */ + @Parameter(property = "config.i18nBundleName") private String i18nBundleName; /** * List of application config to include in report (separated by comma). * <p/> - * <strong>Note:</strong> If not filled then will use all config found in class-path. + * <strong>Note:</strong> If not filled then will use all config + * found in class-path. * - * @parameter property="config.include" * @since 2.4.8 */ + @Parameter(property = "config.include") private String include; /** @@ -103,9 +108,9 @@ * <p/> * <strong>Note:</strong> If not filled no config will be exclude. * - * @parameter property="config.exclude" * @since 2.4.8 */ + @Parameter(property = "config.exclude") private String exclude; /** @@ -114,52 +119,50 @@ * <b>Note:</b> Verbose mode is always on if you starts a debug maven instance * (says via {@code -X}). * - * @parameter property="config.verbose" default-value="${maven.verbose}" * @since 2.4.8 */ + @Parameter(property = "config.verbose", defaultValue = "${maven.verbose}") private boolean verbose; /** * Flag to render option in detail (add a section for each option). * - * @parameter property="config.showOptionDetail" default-value="true" * @since 2.4.8 */ + @Parameter(property = "config.showOptionDetail", defaultValue = "true") private boolean showOptionDetail; /** * Skip to generate the report. * - * @parameter property="config.skip" * @since 2.4.8 */ + @Parameter(property = "config.skip") private boolean skip; /** * The Maven Project. * - * @parameter property="project" - * @required - * @readonly * @since 2.4.8 */ + @Component private MavenProject project; /** - * Doxia Site Renderer. + * Doxia Site Renderer component. * - * @component * @since 2.4.8 */ + @Component private Renderer siteRenderer; /** - * Internationalization. + * Internationalization component. * - * @component * @since 2.4.8 */ + @Component private I18N i18n; /** Modified: trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AggregateApplicationConfigReport.java =================================================================== --- trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AggregateApplicationConfigReport.java 2012-08-30 14:43:50 UTC (rev 2408) +++ trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/AggregateApplicationConfigReport.java 2012-09-02 16:36:14 UTC (rev 2409) @@ -24,6 +24,11 @@ package org.nuiton.util.plugin.report; import org.apache.maven.artifact.DependencyResolutionRequiredException; +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.reporting.MavenReportException; import org.nuiton.util.ApplicationConfigProvider; @@ -39,23 +44,21 @@ * For each configuration, you can find all his options and actions. * * @author tchemit <chemit@codelutin.com> - * @goal aggregate-application-config-report - * @requiresDependencyResolution runtime - * @requiresProject true - * @aggregator * @since 2.4.9 */ +@Mojo(name = "aggregate-application-config-report", aggregator = true, + requiresProject = true, requiresReports = true, + requiresDependencyResolution = ResolutionScope.RUNTIME) +@Execute(phase = LifecyclePhase.COMPILE) public class AggregateApplicationConfigReport extends AbstractApplicationConfigReport { /** * The projects in the reactor. * - * @parameter property="reactorProjects" - * @readonly - * @required - * @since 1.0 + * @since 2.4.9 */ - protected List<?> reactorProjects; + @Parameter(property = "reactorProjects", readonly = true, required = true) + private List<?> reactorProjects; @Override protected ClassLoader createClassLoader() throws MavenReportException { @@ -63,9 +66,8 @@ for (Object o : reactorProjects) { MavenProject p = (MavenProject) o; - List runtimeClasspathElements = null; try { - runtimeClasspathElements = p.getRuntimeClasspathElements(); + List runtimeClasspathElements = p.getRuntimeClasspathElements(); paths.addAll(runtimeClasspathElements); } catch (DependencyResolutionRequiredException e) { throw new MavenReportException("Could not obtain dependencies for project " + p); Modified: trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/ApplicationConfigReport.java =================================================================== --- trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/ApplicationConfigReport.java 2012-08-30 14:43:50 UTC (rev 2408) +++ trunk/nuiton-utils-maven-report-plugin/src/main/java/org/nuiton/util/plugin/report/ApplicationConfigReport.java 2012-09-02 16:36:14 UTC (rev 2409) @@ -24,6 +24,9 @@ */ package org.nuiton.util.plugin.report; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.nuiton.util.ApplicationConfigProvider; import java.util.HashSet; @@ -36,21 +39,20 @@ * For each configuration, you can find all his options and actions. * * @author tchemit <chemit@codelutin.com> - * @goal application-config-report - * @requiresDependencyResolution runtime - * @requiresProject true * @since 2.4.8 */ +@Mojo(name = "application-config-report", + requiresProject = true, requiresReports = true, + requiresDependencyResolution = ResolutionScope.RUNTIME) public class ApplicationConfigReport extends AbstractApplicationConfigReport { /** - * List of all class path elements. + * List of all class-path elements. * - * @parameter property="project.runtimeClasspathElements" - * @required - * @readonly * @since 2.4.8 */ + @Parameter(property = "project.runtimeClasspathElements", + required = true, readonly = true) private List<String> runtimeClasspathElements; @Override Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-08-30 14:43:50 UTC (rev 2408) +++ trunk/pom.xml 2012-09-02 16:36:14 UTC (rev 2409) @@ -221,6 +221,13 @@ </dependency> <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>${pluginPluginVersion}</version> + <scope>provided</scope> + </dependency> + + <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-api</artifactId> <version>2.2.1</version>
participants (1)
-
tchemit@users.nuiton.org