|
|
e9ade24 |
From 61004624dc5027f116cd816add736c978da4ddaf Mon Sep 17 00:00:00 2001
|
|
|
c85efa1 |
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
|
|
c85efa1 |
Date: Mon, 27 Apr 2020 12:52:15 +0200
|
|
|
c85efa1 |
Subject: [PATCH 1/3] Disable help MOJO generation
|
|
|
c85efa1 |
|
|
|
c85efa1 |
---
|
|
|
c85efa1 |
.../plugin/plugin/HelpGeneratorMojo.java | 20 +------------------
|
|
|
c85efa1 |
.../generator/PluginDescriptorGenerator.java | 11 ----------
|
|
|
c85efa1 |
2 files changed, 1 insertion(+), 30 deletions(-)
|
|
|
c85efa1 |
|
|
|
c85efa1 |
diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
|
|
|
e9ade24 |
index 7cc472e5..a51430d1 100644
|
|
|
c85efa1 |
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
|
|
|
c85efa1 |
+++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
|
|
|
c85efa1 |
@@ -28,8 +28,6 @@ import org.apache.maven.plugins.annotations.Mojo;
|
|
|
c85efa1 |
import org.apache.maven.plugins.annotations.Parameter;
|
|
|
c85efa1 |
import org.apache.maven.plugins.annotations.ResolutionScope;
|
|
|
c85efa1 |
import org.apache.maven.tools.plugin.generator.Generator;
|
|
|
c85efa1 |
-import org.apache.maven.tools.plugin.generator.PluginHelpGenerator;
|
|
|
c85efa1 |
-import org.codehaus.plexus.velocity.VelocityComponent;
|
|
|
c85efa1 |
|
|
|
c85efa1 |
/**
|
|
|
c85efa1 |
* Generates a HelpMojo class.
|
|
|
c85efa1 |
@@ -58,12 +56,6 @@ public class HelpGeneratorMojo
|
|
|
c85efa1 |
@Parameter
|
|
|
c85efa1 |
private String helpPackageName;
|
|
|
c85efa1 |
|
|
|
c85efa1 |
- /**
|
|
|
c85efa1 |
- * Velocity component.
|
|
|
c85efa1 |
- */
|
|
|
c85efa1 |
- @Component
|
|
|
c85efa1 |
- private VelocityComponent velocity;
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
/**
|
|
|
c85efa1 |
* {@inheritDoc}
|
|
|
c85efa1 |
*/
|
|
|
e9ade24 |
@@ -79,7 +71,7 @@ public class HelpGeneratorMojo
|
|
|
e9ade24 |
@Override
|
|
|
c85efa1 |
protected Generator createGenerator()
|
|
|
c85efa1 |
{
|
|
|
c85efa1 |
- return new PluginHelpGenerator().setHelpPackageName( helpPackageName ).setVelocityComponent( this.velocity );
|
|
|
c85efa1 |
+ return null;
|
|
|
c85efa1 |
}
|
|
|
c85efa1 |
|
|
|
c85efa1 |
/**
|
|
|
e9ade24 |
@@ -89,16 +81,6 @@ public class HelpGeneratorMojo
|
|
|
c85efa1 |
public void execute()
|
|
|
c85efa1 |
throws MojoExecutionException
|
|
|
c85efa1 |
{
|
|
|
c85efa1 |
- // force value for this plugin
|
|
|
c85efa1 |
- skipErrorNoDescriptorsFound = true;
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
- super.execute();
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
- if ( !project.getCompileSourceRoots().contains( outputDirectory.getAbsolutePath() ) && !skip )
|
|
|
c85efa1 |
- {
|
|
|
c85efa1 |
- project.addCompileSourceRoot( outputDirectory.getAbsolutePath() );
|
|
|
c85efa1 |
- }
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
}
|
|
|
c85efa1 |
|
|
|
c85efa1 |
}
|
|
|
c85efa1 |
diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java
|
|
|
e9ade24 |
index 6e777c08..3d3f8c59 100644
|
|
|
c85efa1 |
--- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java
|
|
|
c85efa1 |
+++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java
|
|
|
e9ade24 |
@@ -65,22 +65,11 @@ public class PluginDescriptorGenerator
|
|
|
c85efa1 |
public void execute( File destinationDirectory, PluginToolsRequest request )
|
|
|
c85efa1 |
throws GeneratorException
|
|
|
c85efa1 |
{
|
|
|
c85efa1 |
- // eventually rewrite help mojo class to match actual package name
|
|
|
c85efa1 |
- PluginHelpGenerator.rewriteHelpMojo( request, log );
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
try
|
|
|
c85efa1 |
{
|
|
|
c85efa1 |
// write complete plugin.xml descriptor
|
|
|
c85efa1 |
File f = new File( destinationDirectory, "plugin.xml" );
|
|
|
c85efa1 |
writeDescriptor( f, request, false );
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
- // write plugin-help.xml help-descriptor
|
|
|
c85efa1 |
- MavenProject mavenProject = request.getProject();
|
|
|
c85efa1 |
-
|
|
|
e9ade24 |
- f = new File( destinationDirectory,
|
|
|
c85efa1 |
- PluginHelpGenerator.getPluginHelpPath( mavenProject ) );
|
|
|
c85efa1 |
-
|
|
|
c85efa1 |
- writeDescriptor( f, request, true );
|
|
|
c85efa1 |
}
|
|
|
c85efa1 |
catch ( IOException e )
|
|
|
c85efa1 |
{
|
|
|
c85efa1 |
--
|
|
|
e9ade24 |
2.35.1
|
|
|
c85efa1 |
|