Class ProtocCompileJavaScriptMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="compile-js",
          defaultPhase=GENERATE_SOURCES,
          requiresDependencyResolution=COMPILE,
          threadSafe=true)
    public final class ProtocCompileJavaScriptMojo
    extends AbstractProtocCompileMojo
    This mojo executes the protoc compiler for generating main JavaScript sources from protocol buffer definitions. It also searches dependency artifacts for .proto files and includes them in the proto_path so that they can be referenced. Finally, it adds the .proto files to the project as resources so that they are included in the final artifact.
    Since:
    0.6.0
    • Field Detail

      • outputDirectory

        @Parameter(required=true,
                   property="javaScriptOutputDirectory",
                   defaultValue="${project.build.directory}/generated-sources/protobuf/js")
        private java.io.File outputDirectory
        This is the directory into which the .js will be created.
      • javaScriptOptions

        @Parameter(required=false,
                   property="javaScriptOptions")
        private java.lang.String javaScriptOptions
        Additional comma-separated options to be passed to the JavaScript generator. Cannot contain colon (:) symbols.
    • Constructor Detail

      • ProtocCompileJavaScriptMojo

        public ProtocCompileJavaScriptMojo()
    • Method Detail

      • getOutputDirectory

        protected java.io.File getOutputDirectory()
        Description copied from class: AbstractProtocMojo
        Returns the output directory for generated sources. Depends on build phase so must be defined in concrete implementation.
        Specified by:
        getOutputDirectory in class AbstractProtocMojo
        Returns:
        output directory for generated sources.