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
Nested ClassesModifier and TypeClassDescriptionprotected static classProperties which provides a sorted keySet(). -
Field Summary
Fields inherited from class org.apache.maven.plugins.help.AbstractHelpMojo
LINE_LENGTH, LS, output, project, projectBuilder, repositorySystem, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEffectiveMojo(org.apache.maven.project.ProjectBuilder projectBuilder, org.eclipse.aether.RepositorySystem repositorySystem) -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringprettyFormat(String effectiveModel, String encoding, boolean omitDeclaration) protected static voidwriteComment(org.codehaus.plexus.util.xml.XMLWriter writer, String comment) Write comments in a normalize way.protected static voidwriteHeader(org.codehaus.plexus.util.xml.XMLWriter writer) Write comments in the Effective POM/settings header.protected static voidwriteXmlFile(File output, String content) Utility method to write an XML content to a given file.Methods inherited from class org.apache.maven.plugins.help.AbstractHelpMojo
getAetherArtifact, getMavenProject, resolveArtifact, writeFile, writeFileMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Constructor Details
-
AbstractEffectiveMojo
protected AbstractEffectiveMojo(org.apache.maven.project.ProjectBuilder projectBuilder, org.eclipse.aether.RepositorySystem repositorySystem)
-
-
Method Details
-
writeXmlFile
Utility method to write an XML content to 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
effectiveModelif an error occurred.
-