Package org.apache.maven.plugins.help
Class AbstractEffectiveMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.help.AbstractHelpMojo
org.apache.maven.plugins.help.AbstractEffectiveMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
EffectivePomMojo
,EffectiveSettingsMojo
Base class with common utilities to write effective Pom/settings.
- Since:
- 2.1
- Author:
- Vincent Siveton
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Properties which provides a sorted keySet(). -
Field Summary
Fields inherited from class org.apache.maven.plugins.help.AbstractHelpMojo
LINE_LENGTH, LS, output, project, projectBuilder, repositorySystem, session
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
prettyFormat
(String effectiveModel, String encoding, boolean omitDeclaration) protected static void
writeComment
(org.codehaus.plexus.util.xml.XMLWriter writer, String comment) Write comments in a normalize way.protected static void
writeHeader
(org.codehaus.plexus.util.xml.XMLWriter writer) Write comments in the Effective POM/settings header.protected static void
writeXmlFile
(File output, String content) Utility method to write an XML content in a given file.Methods inherited from class org.apache.maven.plugins.help.AbstractHelpMojo
getAetherArtifact, getMavenProject, resolveArtifact, writeFile, writeFile
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Constructor Details
-
AbstractEffectiveMojo
public AbstractEffectiveMojo()
-
-
Method Details
-
writeXmlFile
Utility method to write an XML content in a given file.- Parameters:
output
- is the wanted output file.content
- contains the XML content to be written to the file.- Throws:
IOException
- if any- See Also:
-
writeHeader
protected static void writeHeader(org.codehaus.plexus.util.xml.XMLWriter writer) Write comments in the Effective POM/settings header.- Parameters:
writer
- not null
-
writeComment
Write comments in a normalize way.- Parameters:
writer
- not nullcomment
- not null
-
prettyFormat
protected static String prettyFormat(String effectiveModel, String encoding, boolean omitDeclaration) - Parameters:
effectiveModel
- not nullencoding
- not nullomitDeclaration
- whether the XML declaration should be omitted from the effective pom- Returns:
- pretty format of the xml or the original
effectiveModel
if an error occurred.
-