Klasse AbstractGitOutputMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
com.github.koraktor.mavanagaiata.mojo.AbstractGitOutputMojo
- Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Bekannte direkte Unterklassen:
ChangelogMojo
,ContributorsMojo
This abstract Mojo implements writing output to a
PrintStream
This is either System.out
by default, but maybe another
PrintStream
object wrapped around a file given by outputFile
.- Seit:
- 0.2.2
- Autor:
- Sebastian Staudt
- Siehe auch:
-
Feldübersicht
Modifizierer und TypFeldBeschreibung(Package privat) String
The encoding to use for generated output(Package privat) String
The footer to print below the output(Package privat) PrintStream
Von Klasse geerbte Felder com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
baseDir, dateFormat, dirtyFlag, dirtyIgnoreUntracked, failGracefully, gitDir, head, project, propertyPrefixes, skip, skipNoGit
Von Schnittstelle geerbte Felder org.apache.maven.plugin.Mojo
ROLE
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibung(Package privat) PrintStream
Creates a new print stream for the configured output file and encoding(Package privat) void
generateOutput
(GitRepository repository) Writes the (optional) footer and flushes thePrintStream
after calling the main mojo implementationabstract File
Returns the output file for the generated contentprotected GitRepository
init()
Initializes the output stream for the generated contentprotected void
protected final void
run
(GitRepository repository) Initializes thePrintStream
to use This isSystem.out
if no output file is given (default).abstract void
setOutputFile
(File outputFile) Sets the output file for the generated content(Package privat) static String
unescapeFormatNewlines
(String format) Unescapes newlines for format stringsprotected abstract void
writeOutput
(GitRepository repository) This must be implemented by mojos for writing their outputVon Klasse geerbte Methoden com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
addProperty, execute, initRepository, prepareParameters
Von Klasse geerbte Methoden org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Felddetails
-
encoding
The encoding to use for generated output -
printStream
PrintStream printStream
-
-
Konstruktordetails
-
AbstractGitOutputMojo
AbstractGitOutputMojo()
-
-
Methodendetails
-
unescapeFormatNewlines
Unescapes newlines for format strings- Parameter:
format
- The escaped format string- Gibt zurück:
- The unescaped format string
-
initConfiguration
protected void initConfiguration() -
init
Initializes the output stream for the generated content- Setzt außer Kraft:
init
in KlasseAbstractGitMojo
- Gibt zurück:
false
if the execution should be skipped- Löst aus:
MavanagaiataMojoException
- if the output file can not be opened
-
getOutputFile
Returns the output file for the generated contentHas to be implemented by subclassing mojos, so that the output file can be easily configured.
- Gibt zurück:
- The output file for the generated content
-
run
Initializes thePrintStream
to use This isSystem.out
if no output file is given (default). Otherwise the parent directories ofoutputFile
are created and a newPrintStream
for that file is created.- Angegeben von:
run
in KlasseAbstractGitMojo
- Parameter:
repository
- The repository instance to use- Löst aus:
MavanagaiataMojoException
- if the file specified byoutputFile
cannot be opened for writing or the target directory cannot be created
-
createPrintStream
Creates a new print stream for the configured output file and encoding- Gibt zurück:
- A new print stream
- Löst aus:
FileNotFoundException
- if the output file could not be foundUnsupportedEncodingException
- if the encoding is not supported
-
setOutputFile
Sets the output file for the generated content- Parameter:
outputFile
- The output file for the generated content
-
writeOutput
This must be implemented by mojos for writing their output- Parameter:
repository
- The repository the mojo is running in- Löst aus:
MavanagaiataMojoException
- if the output cannot be generated
-
generateOutput
Writes the (optional) footer and flushes thePrintStream
after calling the main mojo implementation- Parameter:
repository
- The repository the mojo is running in- Löst aus:
MavanagaiataMojoException
- if the output cannot be generated- Siehe auch:
-