[MPLUGIN-238] avoid HelpMojo failure when using java-annotations without any configuration

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1599050 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2014-06-01 21:20:30 +00:00
parent 660e74e052
commit bb948bfbc8
3 changed files with 20 additions and 10 deletions

View File

@ -46,6 +46,12 @@ under the License.
<artifactId>plexus-utils</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>@project.version@</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
@ -64,6 +70,10 @@ under the License.
<artifactId>maven-plugin-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>help-goal</id>
<goals>

View File

@ -20,15 +20,17 @@ package test;
*/
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
/**
* MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
* inline link to {@link test.AnotherMojo}.
*
* @goal test
* @deprecated As of 1.0, use the "quoted" goal instead.
* @since 2.1
*/
@Mojo( name= "test" )
public class MyMojo
extends AbstractMojo
{
@ -37,31 +39,26 @@ public class MyMojo
* This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
* escaped in Java string literals.
*
* @parameter default-value="escape\\backslash"
* @since 2.0
*/
@Parameter( defaultValue = "escape\\backslash" )
private String defaultParam;
/**
* This parameter is deprecated.
*
* @parameter
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
*/
@Parameter
private String deprecatedParam;
/**
* @parameter expression="${test.undocumented}"
* @required
*/
@Parameter( property = "test.undocumented", required = true )
private String undocumentedParam;
/**
* Readonly parameter: should not be proposed for configuration.
*
* @parameter default-value="not for configuration"
* @readonly
*/
@Parameter( defaultValue = "not for configuration", readonly = true )
private String readonly;
public void execute()

View File

@ -85,6 +85,9 @@ public class HelpGeneratorMojo
public void execute()
throws MojoExecutionException
{
// force value for this plugin
skipErrorNoDescriptorsFound = true;
super.execute();
if ( !project.getCompileSourceRoots().contains( outputDirectory.getAbsolutePath() ) && !skip )