Author: tchemit Date: Wed Jul 11 08:10:15 2012 New Revision: 1360049 URL: http://svn.apache.org/viewvc?rev=1360049&view=rev Log: [MEJB-59] use maven-plugin-tools' java 5 annotations
Modified: maven/plugins/trunk/maven-ejb-plugin/pom.xml maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java Modified: maven/plugins/trunk/maven-ejb-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ejb-plugin/pom.xml?rev=1360049&r1=1360048&r2=1360049&view=diff ============================================================================== --- maven/plugins/trunk/maven-ejb-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-ejb-plugin/pom.xml Wed Jul 11 08:10:15 2012 @@ -25,7 +25,7 @@ under the License. <parent> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugins</artifactId> - <version>21</version> + <version>22</version> <relativePath>../maven-plugins/pom.xml</relativePath> </parent> @@ -84,6 +84,11 @@ under the License. </exclusions> </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-filtering</artifactId> <version>${mavenFilteringVersion}</version> @@ -112,6 +117,34 @@ under the License. </dependency> </dependencies> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <version>3.1</version> + <configuration> + <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> + </configuration> + </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> <profile> <id>run-its</id> Modified: maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java?rev=1360049&r1=1360048&r2=1360049&view=diff ============================================================================== --- maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java (original) +++ maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java Wed Jul 11 08:10:15 2012 @@ -25,11 +25,17 @@ import org.apache.maven.artifact.Depende import org.apache.maven.execution.MavenSession; 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.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.filtering.MavenFileFilter; import org.apache.maven.shared.filtering.MavenFilteringException; import org.apache.maven.shared.filtering.MavenResourcesExecution; +import org.codehaus.plexus.archiver.Archiver; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.jar.JarArchiver; import org.codehaus.plexus.archiver.jar.ManifestException; @@ -45,67 +51,58 @@ import java.util.List; * * @author <a href="eveni...@apache.org">Emmanuel Venisse</a> * @version $Id$ - * @goal ejb - * @requiresDependencyResolution runtime - * @threadSafe - * @phase package */ +@Mojo( name = "ejb", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true, + defaultPhase = LifecyclePhase.PACKAGE ) public class EjbMojo extends AbstractMojo { private static final String EJB_JAR_XML = "META-INF/ejb-jar.xml"; // TODO: will null work instead? - private static final String[] DEFAULT_INCLUDES = new String[]{"**/**"}; + private static final String[] DEFAULT_INCLUDES = new String[]{ "**/**" }; - private static final String[] DEFAULT_EXCLUDES = new String[]{EJB_JAR_XML, "**/package.html"}; + private static final String[] DEFAULT_EXCLUDES = new String[]{ EJB_JAR_XML, "**/package.html" }; private static final String[] DEFAULT_CLIENT_EXCLUDES = - new String[]{"**/*Bean.class", "**/*CMP.class", "**/*Session.class", "**/package.html"}; + new String[]{ "**/*Bean.class", "**/*CMP.class", "**/*Session.class", "**/package.html" }; private static final String[] EMPTY_STRING_ARRAY = new String[0]; /** * The directory for the generated EJB. - * - * @parameter default-value="${project.build.directory}" - * @required - * @readonly */ + @Parameter( defaultValue = "${project.build.directory}", required = true, readonly = true ) private File basedir; /** * Directory that resources are copied to during the build. - * - * @parameter default-value="${project.build.outputDirectory}" expression="${outputDirectory}" */ + @Parameter( property = "outputDirectory", defaultValue = "${project.build.outputDirectory}" ) private File outputDirectory; /** * The name of the EJB file to generate. - * - * @parameter default-value="${project.build.finalName}" expression="${jarName}" */ + @Parameter( property = "jarName", defaultValue = "${project.build.finalName}" ) private String jarName; /** * Classifier to add to the artifact generated. If given, the artifact will * be an attachment instead. - * - * @parameter expression="${ejb.classifier}" */ + @Parameter( property = "ejb.classifier" ) private String classifier; /** * Whether the EJB client jar should be generated or not. - * - * @parameter default-value="false" expression="${ejb.generateClient}" */ + @Parameter( property = "ejb.generateClient", defaultValue = "false" ) private boolean generateClient; /** * The files and directories to exclude from the client jar. Usage: - * + * <p/> * <pre> * <clientExcludes> * <clientExclude>**/*Ejb.class</clientExclude> @@ -114,14 +111,13 @@ public class EjbMojo * </pre> * <br/>Attribute is used only if client jar is generated. * <br/>Default exclusions: **/*Bean.class, **/*CMP.class, **/*Session.class, **/package.html - * - * @parameter */ + @Parameter private List clientExcludes; /** * The files and directories to include in the client jar. Usage: - * + * <p/> * <pre> * <clientIncludes> * <clientInclude>**/*</clientInclude> @@ -129,14 +125,13 @@ public class EjbMojo * </pre> * <br/>Attribute is used only if client jar is generated. * <br/>Default value: **/** - * - * @parameter */ + @Parameter private List clientIncludes; /** * The files and directories to exclude from the main EJB jar. Usage: - * + * <p/> * <pre> * <excludes> * <exclude>**/*Ejb.class</exclude> @@ -144,24 +139,20 @@ public class EjbMojo * </excludes> * </pre> * <br/>Default exclusions: META-INF/ejb-jar.xml, **/package.html - * @parameter */ + @Parameter private List excludes; /** * The Maven project. - * - * @parameter default-value="${project}" - * @required - * @readonly */ + @Component private MavenProject project; /** * The Jar archiver. - * - * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar" */ + @Component( role = Archiver.class, hint = "jar" ) private JarArchiver jarArchiver; /** @@ -174,81 +165,75 @@ public class EjbMojo * <ejbVersion>3.0</ejbVersion> * </pre> * - * @parameter default-value="2.1" expression="${ejb.ejbVersion}" * @since 2.1 */ + @Parameter( property = "ejb.ejbVersion", defaultValue = "2.1" ) private String ejbVersion; /** * The client Jar archiver. - * - * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar" */ + @Component( role = Archiver.class, hint = "jar" ) private JarArchiver clientJarArchiver; /** * The Maven project's helper. - * - * @component */ + @Component private MavenProjectHelper projectHelper; /** * The archive configuration to use. * See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven Archiver Reference</a>. * This version of the EJB Plugin uses Maven Archiver 2.4. - * - * @parameter */ + @Parameter private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); /** * To escape interpolated value with windows path. * c:\foo\bar will be replaced with c:\\foo\\bar. * - * @parameter default-value="false" expression="${ejb.escapeBackslashesInFilePath}" * @since 2.3 */ + @Parameter( property = "ejb.escapeBackslashesInFilePath", defaultValue = "false" ) private boolean escapeBackslashesInFilePath; /** * An expression preceded with this String won't be interpolated. * \${foo} will be replaced with ${foo}. * - * @parameter expression="${ejb.escapeString}" * @since 2.3 */ + @Parameter( property = "ejb.escapeString" ) protected String escapeString; /** * To filter the deployment descriptor. * - * @parameter default-value="false" expression="${ejb.filterDeploymentDescriptor}" * @since 2.3 */ + @Parameter( property = "ejb.filterDeploymentDescriptor", defaultValue = "false" ) private boolean filterDeploymentDescriptor; /** * Filters (properties files) to include during the interpolation of the deployment descriptor. * - * @parameter * @since 2.3 */ + @Parameter private List filters; /** - * @component role="org.apache.maven.shared.filtering.MavenFileFilter" role-hint="default" - * @required * @since 2.3 */ + @Component( role = MavenFileFilter.class, hint = "default" ) private MavenFileFilter mavenFileFilter; /** - * @parameter expression="${session}" - * @readonly - * @required * @since 2.3 */ + @Component private MavenSession session; /**