[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-ffa450edef68master
parent
660e74e052
commit
bb948bfbc8
|
|
@ -46,6 +46,12 @@ under the License.
|
||||||
<artifactId>plexus-utils</artifactId>
|
<artifactId>plexus-utils</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
|
<artifactId>maven-plugin-annotations</artifactId>
|
||||||
|
<version>@project.version@</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -64,6 +70,10 @@ under the License.
|
||||||
<artifactId>maven-plugin-plugin</artifactId>
|
<artifactId>maven-plugin-plugin</artifactId>
|
||||||
<version>@project.version@</version>
|
<version>@project.version@</version>
|
||||||
<executions>
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-descriptor</id>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
</execution>
|
||||||
<execution>
|
<execution>
|
||||||
<id>help-goal</id>
|
<id>help-goal</id>
|
||||||
<goals>
|
<goals>
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,17 @@ package test;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.plugin.AbstractMojo;
|
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
|
* MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
|
||||||
* inline link to {@link test.AnotherMojo}.
|
* inline link to {@link test.AnotherMojo}.
|
||||||
*
|
*
|
||||||
* @goal test
|
|
||||||
* @deprecated As of 1.0, use the "quoted" goal instead.
|
* @deprecated As of 1.0, use the "quoted" goal instead.
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name= "test" )
|
||||||
public class MyMojo
|
public class MyMojo
|
||||||
extends AbstractMojo
|
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
|
* This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
|
||||||
* escaped in Java string literals.
|
* escaped in Java string literals.
|
||||||
*
|
*
|
||||||
* @parameter default-value="escape\\backslash"
|
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "escape\\backslash" )
|
||||||
private String defaultParam;
|
private String defaultParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter is deprecated.
|
* This parameter is deprecated.
|
||||||
*
|
*
|
||||||
* @parameter
|
|
||||||
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
|
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
|
||||||
*/
|
*/
|
||||||
|
@Parameter
|
||||||
private String deprecatedParam;
|
private String deprecatedParam;
|
||||||
|
|
||||||
/**
|
@Parameter( property = "test.undocumented", required = true )
|
||||||
* @parameter expression="${test.undocumented}"
|
|
||||||
* @required
|
|
||||||
*/
|
|
||||||
private String undocumentedParam;
|
private String undocumentedParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Readonly parameter: should not be proposed for configuration.
|
* 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;
|
private String readonly;
|
||||||
|
|
||||||
public void execute()
|
public void execute()
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,9 @@ public class HelpGeneratorMojo
|
||||||
public void execute()
|
public void execute()
|
||||||
throws MojoExecutionException
|
throws MojoExecutionException
|
||||||
{
|
{
|
||||||
|
// force value for this plugin
|
||||||
|
skipErrorNoDescriptorsFound = true;
|
||||||
|
|
||||||
super.execute();
|
super.execute();
|
||||||
|
|
||||||
if ( !project.getCompileSourceRoots().contains( outputDirectory.getAbsolutePath() ) && !skip )
|
if ( !project.getCompileSourceRoots().contains( outputDirectory.getAbsolutePath() ) && !skip )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue