Package org.codehaus.gmavenplus.mojo
Class AbstractGroovyDocMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovyDocMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
GroovyDocMojo
,GroovyDocTestsMojo
public abstract class AbstractGroovyDocMojo extends AbstractGroovySourcesMojo
The base GroovyDoc mojo, which all GroovyDoc mojos extend.- Since:
- 1.0-beta-1
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
attachGroovyDocAnnotation
Enable attaching GroovyDoc annotation.protected java.lang.String
classpathResourceManagerClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.ClasspathResourceManager, for use when creating custom GroovyDoc implementations.protected java.lang.String[]
defaultClassTemplates
Override the default Groovydoc class-level templates.protected java.lang.String[]
defaultDocTemplates
Override the default Groovydoc default top-level templates.protected java.lang.String[]
defaultPackageTemplates
Override the default Groovydoc package-level templates.protected boolean
displayAuthor
Whether to display the author in the generated GroovyDoc.protected java.lang.String
docTitle
The page title.protected java.lang.String
fileOutputToolClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.FileOutputTool, for use when creating custom GroovyDoc implementations.protected java.lang.String
footer
The page footer.protected static Version
GROOVY_1_5_2
Groovy 1.5.2 version.protected static Version
GROOVY_1_5_8
Groovy 1.5.8 version.protected static Version
GROOVY_1_6_0_RC1
Groovy 1.6.0 RC-1 version.protected static Version
GROOVY_1_6_0_RC2
Groovy 1.6.0 RC-2 version.protected static Version
GROOVY_3_0_0_ALPHA_4
Groovy 3.0.0 alpha-4 version.protected java.lang.String
groovyDocToolClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.GroovyDocTool, for use when creating custom GroovyDoc implementations.protected java.lang.String
header
The page header.protected IncludeClasspath
includeClasspath
What classpath to include.protected java.lang.String
linkArgumentClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.LinkArgument (or org.codehaus.groovy.ant.Groovydoc$LinkArgument for Groovy older than 1.6-RC-2), for use when creating custom GroovyDoc implementations.protected java.util.List<Link>
links
Links to include in the generated GroovyDoc (key is link href, value is comma-separated packages to use that link).protected java.lang.String
outputToolClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.OutputTool, for use when creating custom GroovyDoc implementations.protected java.io.File
overviewFile
The HTML file to be used for overview documentation.protected java.lang.String
resourceManagerClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.ResourceManager, for use when creating custom GroovyDoc implementations.protected java.lang.String
scope
The scope to generate GroovyDoc for.protected boolean
skipGroovyDoc
Flag to allow GroovyDoc generation to be skipped.protected java.lang.String
stylesheetEncoding
The encoding of stylesheetFile.protected java.io.File
stylesheetFile
The stylesheet file (absolute path) to copy to output directory (will overwrite default stylesheet.css).protected java.lang.String
windowTitle
The window title.-
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
MAIN, TEST
-
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
classWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_1_8, JAVA_12, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session
-
-
Constructor Summary
Constructors Constructor Description AbstractGroovyDocMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
copyStylesheet(java.io.File outputDirectory)
Copies the stylesheet to the specified output directory.protected java.lang.Object
createGroovyDocTool(java.lang.Class<?> groovyDocToolClass, java.lang.Class<?> resourceManagerClass, java.util.Properties docProperties, java.lang.Object classpathResourceManager, java.util.List<java.lang.String> sourceDirectories, GroovyDocTemplateInfo groovyDocTemplateInfo, java.util.List<?> groovyDocLinks)
Instantiates a new GroovyDocTool.protected void
doGroovyDocGeneration(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, java.util.List<?> classpath, java.io.File outputDirectory)
Generates the GroovyDoc for the specified sources.protected void
generateGroovyDoc(java.io.File outputDirectory, java.lang.Class<?> groovyDocToolClass, java.lang.Class<?> outputToolClass, java.lang.Object fileOutputTool, java.util.List<java.lang.String> groovyDocSources, java.lang.Object groovyDocTool)
Performs the GroovyDoc generation.protected java.util.List<java.lang.String>
setupGroovyDocSources(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, org.apache.maven.shared.model.fileset.util.FileSetManager fileSetManager)
Gets the Groovy sources without the Java sources (since the Java sources don't have Javadoc).protected java.util.List<?>
setupLinks()
Sets up the GroovyDoc links.protected java.util.Properties
setupProperties()
Sets up the documentation properties.-
Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
getFiles, getFilesets, getTestFiles, getTestFilesets
-
Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
getJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isGroovyIndy, isJavaSupportIndy, isJavaSupportParameters, isJavaSupportPreviewFeatures, logPluginClasspath, setupClassWrangler
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
GROOVY_3_0_0_ALPHA_4
protected static final Version GROOVY_3_0_0_ALPHA_4
Groovy 3.0.0 alpha-4 version.
-
GROOVY_1_6_0_RC2
protected static final Version GROOVY_1_6_0_RC2
Groovy 1.6.0 RC-2 version.
-
GROOVY_1_6_0_RC1
protected static final Version GROOVY_1_6_0_RC1
Groovy 1.6.0 RC-1 version.
-
GROOVY_1_5_8
protected static final Version GROOVY_1_5_8
Groovy 1.5.8 version.
-
GROOVY_1_5_2
protected static final Version GROOVY_1_5_2
Groovy 1.5.2 version.
-
windowTitle
@Parameter(defaultValue="Groovy Documentation") protected java.lang.String windowTitle
The window title.
-
docTitle
@Parameter(defaultValue="Groovy Documentation") protected java.lang.String docTitle
The page title.
-
footer
@Parameter(defaultValue="Groovy Documentation") protected java.lang.String footer
The page footer.
-
header
@Parameter(defaultValue="Groovy Documentation") protected java.lang.String header
The page header.
-
displayAuthor
@Parameter(defaultValue="true") protected boolean displayAuthor
Whether to display the author in the generated GroovyDoc.
-
overviewFile
@Parameter protected java.io.File overviewFile
The HTML file to be used for overview documentation.
-
stylesheetFile
@Parameter protected java.io.File stylesheetFile
The stylesheet file (absolute path) to copy to output directory (will overwrite default stylesheet.css).
-
stylesheetEncoding
@Parameter(defaultValue="${project.build.sourceEncoding}") protected java.lang.String stylesheetEncoding
The encoding of stylesheetFile.
-
scope
@Parameter(defaultValue="private") protected java.lang.String scope
The scope to generate GroovyDoc for. Should be one of:- "public"
- "protected"
- "package"
- "private"
-
links
@Parameter protected java.util.List<Link> links
Links to include in the generated GroovyDoc (key is link href, value is comma-separated packages to use that link).- Since:
- 1.0-beta-2
-
skipGroovyDoc
@Parameter(property="skipGroovydoc", defaultValue="false") protected boolean skipGroovyDoc
Flag to allow GroovyDoc generation to be skipped.- Since:
- 1.6
-
includeClasspath
@Parameter(defaultValue="PROJECT_ONLY") protected IncludeClasspath includeClasspath
What classpath to include. One of- PROJECT_ONLY
- PROJECT_AND_PLUGIN
- PLUGIN_ONLY
- Since:
- 1.8.0
-
defaultDocTemplates
@Parameter protected java.lang.String[] defaultDocTemplates
Override the default Groovydoc default top-level templates. Uses Groovy's standard templates by default.- Since:
- 1.10.1
-
defaultPackageTemplates
@Parameter protected java.lang.String[] defaultPackageTemplates
Override the default Groovydoc package-level templates. Uses Groovy's standard templates by default.- Since:
- 1.10.1
-
defaultClassTemplates
@Parameter protected java.lang.String[] defaultClassTemplates
Override the default Groovydoc class-level templates. Uses Groovy's standard templates by default.- Since:
- 1.10.1
-
groovyDocToolClass
@Parameter protected java.lang.String groovyDocToolClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.GroovyDocTool, for use when creating custom GroovyDoc implementations.- Since:
- 1.10.1
-
outputToolClass
@Parameter protected java.lang.String outputToolClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.OutputTool, for use when creating custom GroovyDoc implementations.- Since:
- 1.10.1
-
fileOutputToolClass
@Parameter protected java.lang.String fileOutputToolClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.FileOutputTool, for use when creating custom GroovyDoc implementations.- Since:
- 1.10.1
-
resourceManagerClass
@Parameter protected java.lang.String resourceManagerClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.ResourceManager, for use when creating custom GroovyDoc implementations.- Since:
- 1.10.1
-
classpathResourceManagerClass
@Parameter protected java.lang.String classpathResourceManagerClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.ClasspathResourceManager, for use when creating custom GroovyDoc implementations.- Since:
- 1.10.1
-
linkArgumentClass
@Parameter protected java.lang.String linkArgumentClass
Allows you to override the class that is normally org.codehaus.groovy.tools.groovydoc.LinkArgument (or org.codehaus.groovy.ant.Groovydoc$LinkArgument for Groovy older than 1.6-RC-2), for use when creating custom GroovyDoc implementations.- Since:
- 1.10.1
-
attachGroovyDocAnnotation
@Parameter(defaultValue="false") protected boolean attachGroovyDocAnnotation
Enable attaching GroovyDoc annotation. Requires Groovy 3.0.0 alpha-4 or newer.- Since:
- 1.11.0
-
-
Method Detail
-
doGroovyDocGeneration
protected void doGroovyDocGeneration(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, java.util.List<?> classpath, java.io.File outputDirectory) throws java.lang.ClassNotFoundException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.net.MalformedURLException
Generates the GroovyDoc for the specified sources.- Parameters:
sourceDirectories
- The source directories to generate GroovyDoc forclasspath
- The classpath to use for compilationoutputDirectory
- The directory to save the generated GroovyDoc in- Throws:
java.lang.ClassNotFoundException
- when a class needed for GroovyDoc generation cannot be foundjava.lang.InstantiationException
- when a class needed for GroovyDoc generation cannot be instantiatedjava.lang.IllegalAccessException
- when a method needed for GroovyDoc generation cannot be accessedjava.lang.reflect.InvocationTargetException
- when a reflection invocation needed for GroovyDoc generation cannot be completedjava.net.MalformedURLException
- when a classpath element provides a malformed URL
-
setupProperties
protected java.util.Properties setupProperties()
Sets up the documentation properties.- Returns:
- the documentation properties
-
setupLinks
protected java.util.List<?> setupLinks() throws java.lang.ClassNotFoundException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.InstantiationException
Sets up the GroovyDoc links.- Returns:
- the GroovyDoc links
- Throws:
java.lang.ClassNotFoundException
- when a class needed for setting up GroovyDoc links cannot be foundjava.lang.InstantiationException
- when a class needed for setting up GroovyDoc links cannot be instantiatedjava.lang.IllegalAccessException
- when a method needed for setting up GroovyDoc links cannot be accessedjava.lang.reflect.InvocationTargetException
- when a reflection invocation needed for setting up GroovyDoc links cannot be completed
-
createGroovyDocTool
protected java.lang.Object createGroovyDocTool(java.lang.Class<?> groovyDocToolClass, java.lang.Class<?> resourceManagerClass, java.util.Properties docProperties, java.lang.Object classpathResourceManager, java.util.List<java.lang.String> sourceDirectories, GroovyDocTemplateInfo groovyDocTemplateInfo, java.util.List<?> groovyDocLinks) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.InstantiationException
Instantiates a new GroovyDocTool.- Parameters:
groovyDocToolClass
- the GroovyDocTool classresourceManagerClass
- the ResourceManager lassdocProperties
- the documentation propertiesclasspathResourceManager
- the ClasspathResourceManager for the GroovyDocToolsourceDirectories
- the source directories for the GroovyDocToolgroovyDocTemplateInfo
- the GroovyDocTemplateInfo for the GroovyDocToolgroovyDocLinks
- the GroovyDoc links- Returns:
- the GroovyDocTool to use in GroovyDoc generation
- Throws:
java.lang.InstantiationException
- when a class needed for setting up GroovyDoc tool cannot be instantiatedjava.lang.IllegalAccessException
- when a method needed for setting up GroovyDoc tool cannot be accessedjava.lang.reflect.InvocationTargetException
- when a reflection invocation needed for setting up GroovyDoc tool cannot be completed
-
setupGroovyDocSources
protected java.util.List<java.lang.String> setupGroovyDocSources(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, org.apache.maven.shared.model.fileset.util.FileSetManager fileSetManager)
Gets the Groovy sources without the Java sources (since the Java sources don't have Javadoc).- Parameters:
sourceDirectories
- the source directories to get the Groovy sources fromfileSetManager
- the FileSetmanager to use to get the included files- Returns:
- the groovy sources
-
generateGroovyDoc
protected void generateGroovyDoc(java.io.File outputDirectory, java.lang.Class<?> groovyDocToolClass, java.lang.Class<?> outputToolClass, java.lang.Object fileOutputTool, java.util.List<java.lang.String> groovyDocSources, java.lang.Object groovyDocTool) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
Performs the GroovyDoc generation.- Parameters:
outputDirectory
- the directory to output the GroovyDoc togroovyDocToolClass
- the GroovyDocTool classoutputToolClass
- the OutputTool classfileOutputTool
- the FileOutputTool to use for GroovyDoc generationgroovyDocSources
- the sources togroovyDocTool
- the GroovyDocTool to use for GroovyDoc generation- Throws:
java.lang.IllegalAccessException
- when a method needed for GroovyDoc generation cannot be accessedjava.lang.reflect.InvocationTargetException
- when a reflection invocation needed for GroovyDoc generation cannot be completed
-
copyStylesheet
protected void copyStylesheet(java.io.File outputDirectory)
Copies the stylesheet to the specified output directory.- Parameters:
outputDirectory
- The output directory to copy the stylesheet to
-
-