Klasse InfoClassMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
com.github.koraktor.mavanagaiata.mojo.InfoClassMojo
- Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="info-class",
defaultPhase=GENERATE_SOURCES,
threadSafe=true)
public class InfoClassMojo
extends AbstractGitMojo
This goal generates the source code for a Java class with Git information
like commit ID and tag name.
- Seit:
- 0.5.0
- Autor:
- Sebastian Staudt
-
Verschachtelte Klassen - Übersicht
-
Feldübersicht
Modifizierer und TypFeldBeschreibungprivate static final String
(Package privat) String
The name of the class to generate(Package privat) String
The encoding of the generated source file(Package privat) org.apache.maven.shared.filtering.MavenFileFilter
(Package privat) File
The directory to write the source code to(Package privat) String
The name of the package in which the class will be generatedprivate File
The path to an alternative template for the info classVon 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 TypMethodeBeschreibungprivate File
(Package privat) InputStream
Returns an input stream for the template source file for the info class(Package privat) org.codehaus.plexus.interpolation.MapBasedValueSource
getValueSource
(GitRepository repository) void
run
(GitRepository repository) Generates a info class filled providing information of the Git repositoryprivate void
writeSourceFile
(GitRepository repository, File sourceFile) Von Klasse geerbte Methoden com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
addProperty, execute, init, initRepository, prepareParameters
Von Klasse geerbte Methoden org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Felddetails
-
BUILTIN_TEMPLATE_PATH
- Siehe auch:
-
className
The name of the class to generate -
encoding
@Parameter(property="mavanagaiata.info-class.encoding", defaultValue="${project.build.sourceEncoding}") String encodingThe encoding of the generated source file -
fileFilter
@Component org.apache.maven.shared.filtering.MavenFileFilter fileFilter -
packageName
@Parameter(property="mavanagaiata.info-class.packageName", defaultValue="${project.groupId}.${project.artifactId}") String packageNameThe name of the package in which the class will be generated -
outputDirectory
@Parameter(property="mavanagaiata.info-class.outputDirectory", defaultValue="${project.build.directory}/generated-sources/mavanagaiata") File outputDirectoryThe directory to write the source code toThis directory is automatically added to the source roots used to compile the project.
-
templateFile
The path to an alternative template for the info class
-
-
Konstruktordetails
-
InfoClassMojo
public InfoClassMojo()
-
-
Methodendetails
-
getTemplateSource
Returns an input stream for the template source file for the info classThis may either be the builtin template or an arbitrary source file set via
templatePath
.- Gibt zurück:
- An input stream for the template source file
- Löst aus:
FileNotFoundException
- if the template source cannot be foundIOException
-
run
Generates a info class filled providing information of the Git repository- Angegeben von:
run
in KlasseAbstractGitMojo
- Parameter:
repository
- The repository instance to use- Löst aus:
MavanagaiataMojoException
- if the info class cannot be generated
-
copyTemporaryTemplate
- Löst aus:
IOException
MavanagaiataMojoException
-
getValueSource
org.codehaus.plexus.interpolation.MapBasedValueSource getValueSource(GitRepository repository) throws GitRepositoryException - Löst aus:
GitRepositoryException
-
writeSourceFile
private void writeSourceFile(GitRepository repository, File sourceFile) throws GitRepositoryException, MavanagaiataMojoException, org.apache.maven.shared.filtering.MavenFilteringException - Löst aus:
GitRepositoryException
MavanagaiataMojoException
org.apache.maven.shared.filtering.MavenFilteringException
-