Package io.protostuff.mojo
Class ProtoCompilerMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.protostuff.mojo.ProtoCompilerMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="compile",
configurator="include-project-dependencies",
requiresDependencyResolution=COMPILE_PLUS_RUNTIME)
public class ProtoCompilerMojo
extends org.apache.maven.plugin.AbstractMojo
Compiles proto files to java/gwt/etc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected File
Maven module base directoryprivate boolean
Whentrue
, the protos are cached for re-use.private org.apache.maven.plugin.MojoExecution
private boolean
Usually most of protostuff mojos will not get executed on parent poms (i.e.static final String
protected File
The properties file that contains the modulesprotected File
If not specified, the directory where the file is located will be used as its base dir.protected org.apache.maven.project.MavenProject
The current Maven project.protected Properties
Plugin properties that are passed to the compilerprotected ProtoModule[]
The modules to generate code fromprivate boolean
Whentrue
, skip the execution.protected File
If not specified, the directory where the file is located will be used as its base dir.private Properties
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
GENERATE_TEST_SOURCES_PHASE
- See Also:
-
project
@Parameter(property="project", required=true, readonly=true) protected org.apache.maven.project.MavenProject projectThe current Maven project. -
skip
@Parameter(property="protostuff.compiler.skip", defaultValue="false") private boolean skipWhentrue
, skip the execution.- Since:
- 1.0.1
-
cacheProtos
@Parameter(property="protostuff.compiler.cache_protos", defaultValue="false") private boolean cacheProtosWhentrue
, the protos are cached for re-use. This matters when a certain proto is also used/imported by other modules.- Since:
- 1.0.5
-
forceMojoExecution
@Parameter(property="protostuff.compiler.force", defaultValue="false", required=true) private boolean forceMojoExecutionUsually most of protostuff mojos will not get executed on parent poms (i.e. projects with packaging type 'pom'). Setting this parameter totrue
will force the execution of this mojo, even if it would usually get skipped in this case.- Since:
- 1.0.1
-
modulesFile
The properties file that contains the modules -
sourceBaseDir
If not specified, the directory where the file is located will be used as its base dir.This is only relevent when
is provided
.- Since:
- 1.0.8
-
outputBaseDir
If not specified, the directory where the file is located will be used as its base dir.This is only relevent when
is provided
.- Since:
- 1.0.8
-
protoModules
The modules to generate code from -
baseDir
Maven module base directory -
properties
Plugin properties that are passed to the compiler- Since:
- 1.3.1
-
execution
@Component private org.apache.maven.plugin.MojoExecution execution -
systemPropertiesBackup
-
-
Constructor Details
-
ProtoCompilerMojo
public ProtoCompilerMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
updateRelativeOutputLocation
-
setSystemProperties
private void setSystemProperties() -
resetSystemProperties
private void resetSystemProperties() -
skipMojo
protected boolean skipMojo()Determine if the mojo execution should get skipped.
This is the case if:skip
istrue
- if the mojo gets executed on a project with packaging type 'pom' and
forceMojoExecution
isfalse
- Returns:
true
if the mojo execution should be skipped.- Since:
- 1.0.1
-