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:
- ContextEnabled, Mojo
- Direct Known Subclasses:
- EffectivePomMojo, EffectiveSettingsMojo
public abstract class AbstractEffectiveMojo
- extends AbstractHelpMojo
Base class with common utilities to write effective Pom/settings.
- Since:
- 2.1
- Version:
- $Id: AbstractEffectiveMojo.java 1446786 2013-02-15 21:54:28Z rfscholte $
- Author:
- Vincent Siveton
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
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 |
AbstractEffectiveMojo
public AbstractEffectiveMojo()
writeXmlFile
protected static void writeXmlFile(File output,
String content,
String encoding)
throws IOException
- 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.encoding
- is the wanted encoding to use when writing file.
- Throws:
IOException
- if any- See Also:
if encoding is null.
writeHeader
protected static void writeHeader(XMLWriter writer)
- Write comments in the Effective POM/settings header.
- Parameters:
writer
- not null
writeComment
protected static void writeComment(XMLWriter writer,
String comment)
- Write comments in a normalize way.
- Parameters:
writer
- not nullcomment
- not null
addMavenNamespace
protected static String addMavenNamespace(String effectiveXml,
boolean isPom)
- Add a Pom/Settings namespaces to the effective XML content.
- Parameters:
effectiveXml
- not null the effective POM or SettingsisPom
- if true
add the Pom xsd url, otherwise add the settings xsd url.
- Returns:
- the content of the root element, i.e. <project/> or <settings/> with the Maven namespace or
the original
effective
if an error occurred. - See Also:
POM_XSD_URL
,
SETTINGS_XSD_URL
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.