Author: dennisl
Date: Mon Nov 5 20:50:43 2012
New Revision: 1405948
URL: http://svn.apache.org/viewvc?rev=1405948&view=rev
Log:
[MPLUGIN-223] HelpMojo is not extracted when using java-annotations extractor
- Add an IT to verify that this issue has been solved
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties
(with props)
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml
(with props)
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
(with props)
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy
(with props)
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties?rev=1405948&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties
Mon Nov 5 20:50:43 2012
@@ -0,0 +1,15 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+invoker.goals.1 = clean verify -DskipTests
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml?rev=1405948&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml
(added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml Mon
Nov 5 20:50:43 2012
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.plugin.its</groupId>
+ <artifactId>massembly-223</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+
+ <name>massembly-223 Maven Plugin</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+ <mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>${mavenPluginPluginVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>${mavenPluginPluginVersion}</version>
+ <configuration>
+ <extractors>
+ <extractor>java-annotations</extractor>
+ </extractors>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <id>mojo-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>help-goal</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java?rev=1405948&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
Mon Nov 5 20:50:43 2012
@@ -0,0 +1,81 @@
+package org.apache.maven.plugins.plugin.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Goal which touches a timestamp file.
+ */
+@Mojo(name = "touch", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
+public class MyMojo
+ extends AbstractMojo
+{
+ /**
+ * Location of the file.
+ */
+ @Parameter(defaultValue = "${project.build.directory}", required = true)
+ private File outputDirectory;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ File f = outputDirectory;
+
+ if ( !f.exists() )
+ {
+ f.mkdirs();
+ }
+
+ File touch = new File( f, "touch.txt" );
+
+ FileWriter w = null;
+ try
+ {
+ w = new FileWriter( touch );
+
+ w.write( "touch.txt" );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "Error creating file " + touch,
e );
+ }
+ finally
+ {
+ if ( w != null )
+ {
+ try
+ {
+ w.close();
+ }
+ catch ( IOException e )
+ {
+ // ignore
+ }
+ }
+ }
+ }
+}
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy?rev=1405948&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy
Mon Nov 5 20:50:43 2012
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+File descriptorFile = new File( basedir,
"target/classes/META-INF/maven/plugin.xml" );
+assert descriptorFile.isFile()
+
+def pluginDescriptor = new XmlParser().parse( descriptorFile );
+
+def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "help" }[0]
+
+// check help mojo plugin descriptor
+assert mojo != null
+
+return true;
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-223/verify.groovy
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id