Class PluginDescriptorFilesGenerator
- java.lang.Object
-
- org.apache.maven.tools.plugin.generator.PluginDescriptorFilesGenerator
-
- All Implemented Interfaces:
Generator
public class PluginDescriptorFilesGenerator extends java.lang.Object implements Generator
Serializes- a standard Maven Plugin Descriptor XML file
- a descriptor containing a limited set of attributes for
PluginHelpGenerator
- an enhanced descriptor containing HTML values for some elements (instead of plain text as for the other two)
for
PluginXdocGenerator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
PluginDescriptorFilesGenerator.DescriptorType
The type of the plugin descriptor file
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description PluginDescriptorFilesGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.io.File destinationDirectory, PluginToolsRequest request)
Execute the generation for a given plugin descriptor.static java.io.File
getEnhancedDescriptorFilePath(org.apache.maven.project.MavenProject project)
private java.lang.String
getExpression(org.apache.maven.plugin.descriptor.Parameter parameter)
Get the expression value, eventually surrounding it with${ }
.(package private) static java.net.URI
getJavadocUrlForType(JavadocLinkGenerator javadocLinkGenerator, java.lang.String type)
private static java.lang.String
getTextValue(PluginDescriptorFilesGenerator.DescriptorType type, boolean containsXhtmlValue, java.lang.String text)
private java.lang.String
getVersion()
protected void
processMojoDescriptor(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w, PluginDescriptorFilesGenerator.DescriptorType type, JavadocLinkGenerator javadocLinkGenerator)
void
writeDescriptor(java.io.File destinationFile, PluginToolsRequest request, PluginDescriptorFilesGenerator.DescriptorType type)
protected void
writeParameterType(org.codehaus.plexus.util.xml.XMLWriter w, PluginDescriptorFilesGenerator.DescriptorType type, JavadocLinkGenerator javadocLinkGenerator, org.apache.maven.plugin.descriptor.Parameter parameter, java.lang.String goal)
Writes parameter type information and potentially also the related javadoc URL.
-
-
-
Method Detail
-
execute
public void execute(java.io.File destinationDirectory, PluginToolsRequest request) throws GeneratorException
Description copied from interface:Generator
Execute the generation for a given plugin descriptor.- Specified by:
execute
in interfaceGenerator
- Parameters:
destinationDirectory
- requiredrequest
- required- Throws:
GeneratorException
- if any
-
getEnhancedDescriptorFilePath
public static java.io.File getEnhancedDescriptorFilePath(org.apache.maven.project.MavenProject project)
-
getVersion
private java.lang.String getVersion()
-
writeDescriptor
public void writeDescriptor(java.io.File destinationFile, PluginToolsRequest request, PluginDescriptorFilesGenerator.DescriptorType type) throws java.io.IOException
- Throws:
java.io.IOException
-
getTextValue
private static java.lang.String getTextValue(PluginDescriptorFilesGenerator.DescriptorType type, boolean containsXhtmlValue, java.lang.String text)
- Parameters:
type
-containsXhtmlValue
-text
-- Returns:
- the normalized text value (i.e. potentially converted to XHTML)
-
processMojoDescriptor
protected void processMojoDescriptor(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w, PluginDescriptorFilesGenerator.DescriptorType type, JavadocLinkGenerator javadocLinkGenerator)
-
writeParameterType
protected void writeParameterType(org.codehaus.plexus.util.xml.XMLWriter w, PluginDescriptorFilesGenerator.DescriptorType type, JavadocLinkGenerator javadocLinkGenerator, org.apache.maven.plugin.descriptor.Parameter parameter, java.lang.String goal)
Writes parameter type information and potentially also the related javadoc URL.- Parameters:
w
-type
-javadocLinkGenerator
-parameter
-goal
-
-
getJavadocUrlForType
static java.net.URI getJavadocUrlForType(JavadocLinkGenerator javadocLinkGenerator, java.lang.String type)
-
getExpression
private java.lang.String getExpression(org.apache.maven.plugin.descriptor.Parameter parameter)
Get the expression value, eventually surrounding it with${ }
.- Parameters:
parameter
- the parameter- Returns:
- the expression value
-
-