Class TestGenerateMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
Unlike the generate
goal, these sources will only be visible
to tests, and will not be included in any final JAR of the project main sources.
Any project dependencies using the compile
, provided
,
system
, or test
scopes will be made available to import from protobuf sources.
By default, sources will be read from src/test/protobuf
,
and generated sources will be written to target/generated-test-sources/protobuf
.
Generally, you won't need to use this. It can be useful in some more specific use cases where you are only using the protobuf definitions within the context of a test.
- Author:
- Ashley Scopes
-
Field Summary
Fields inherited from class io.github.ascopes.protobufmavenplugin.mojo.AbstractGenerateMojo
binaryMavenPlugins, binaryPathPlugins, binaryUrlPlugins, cppEnabled, csharpEnabled, dependencyResolutionDepth, dependencyScopes, embedSourcesInClassOutputs, excludes, failOnInvalidDependencies, failOnMissingSources, failOnMissingTargets, fatalWarnings, ignoreProjectDependencies, importDependencies, importPaths, includes, incrementalCompilation, javaEnabled, jvmMavenPlugins, kotlinEnabled, liteOnly, mavenProject, mavenProjectHelper, objcEnabled, outputDescriptorAttached, outputDescriptorAttachmentClassifier, outputDescriptorAttachmentType, outputDescriptorFile, outputDescriptorIncludeImports, outputDescriptorIncludeSourceInfo, outputDescriptorRetainOptions, outputDirectory, phpEnabled, protocVersion, pythonEnabled, pythonStubsEnabled, registerAsCompilationRoot, rubyEnabled, rustEnabled, skip, sourceCodeGenerator, sourceDependencies, sourceDirectories
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe default dependency scopes used for resolution.(package private) Path
Provides the default output directory to write generated code to.(package private) Path
Provides the default source directory to read protobuf sources from.(package private) OutputDescriptorAttachmentRegistrar
Provides the registrar for output descriptor files to attach them to the Maven project as additional artifacts.(package private) SourceRootRegistrar
Provides the source root registrar for this Mojo.Methods inherited from class io.github.ascopes.protobufmavenplugin.mojo.AbstractGenerateMojo
execute
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
TestGenerateMojo
public TestGenerateMojo()
-
-
Method Details
-
sourceRootRegistrar
SourceRootRegistrar sourceRootRegistrar()Description copied from class:AbstractGenerateMojo
Provides the source root registrar for this Mojo.This specifies where to attach generated sources to in order for it to be included as part of the compilation for main or test sources.
- Specified by:
sourceRootRegistrar
in classAbstractGenerateMojo
- Returns:
- the registrar to use.
-
outputDescriptorAttachmentRegistrar
OutputDescriptorAttachmentRegistrar outputDescriptorAttachmentRegistrar()Description copied from class:AbstractGenerateMojo
Provides the registrar for output descriptor files to attach them to the Maven project as additional artifacts.- Specified by:
outputDescriptorAttachmentRegistrar
in classAbstractGenerateMojo
- Returns:
- the registrar to use.
-
defaultDependencyScopes
Description copied from class:AbstractGenerateMojo
The default dependency scopes used for resolution.- Specified by:
defaultDependencyScopes
in classAbstractGenerateMojo
- Returns:
- the set of dependency scopes used for resolution.
-
defaultSourceDirectory
Path defaultSourceDirectory()Description copied from class:AbstractGenerateMojo
Provides the default source directory to read protobuf sources from.This does not need to point to an existing directory, the plugin will handle this automatically.
- Specified by:
defaultSourceDirectory
in classAbstractGenerateMojo
- Returns:
- the path to the directory.
-
defaultOutputDirectory
Path defaultOutputDirectory()Description copied from class:AbstractGenerateMojo
Provides the default output directory to write generated code to.This does not need to point to an existing directory, the plugin will handle this automatically.
- Specified by:
defaultOutputDirectory
in classAbstractGenerateMojo
- Returns:
- the path to the directory.
-