Class SchemaPackageMojo

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

    @Mojo(name="avro-package",
          defaultPhase=PACKAGE,
          requiresProject=true)
    public final class SchemaPackageMojo
    extends org.apache.maven.plugin.AbstractMojo
    mojo that packages a schema package and avro sources and attaches them as separate artifacts.
    • Field Detail

      • mavenProject

        @Parameter(defaultValue="${project}",
                   required=true,
                   readonly=true)
        protected org.apache.maven.project.MavenProject mavenProject
      • dependenciesDirectory

        @Parameter(name="dependenciesDirectory",
                   defaultValue="${project.build.directory}/schema-dependencies",
                   readonly=true)
        protected File dependenciesDirectory
        The directory where all schema dependencies (avsc, avpr, avdl) are made vailable
      • sourceDirectory

        @Parameter(name="sourceDirectory",
                   defaultValue="${basedir}/src/main/avro")
        protected File sourceDirectory
        The source directory of avro files. This directory is added to the classpath at schema compiling time. All files can therefore be referenced as classpath resources following the directory structure under the source directory.
      • generatedJavaTarget

        @Parameter(name="generatedJavaTarget",
                   defaultValue="${project.build.directory}/generated-sources/avro")
        protected File generatedJavaTarget
        the destination for the java generated files.
      • generatedAvscTarget

        @Parameter(name="generatedAvscTarget",
                   defaultValue="${project.build.directory}/generated-sources/avsc")
        protected File generatedAvscTarget
        the destination for the generated avro schema json files (will be published along with the java code).
      • target

        @Parameter(name="target",
                   defaultValue="${project.build.directory}")
        protected File target
        the target folder.
      • mavenSession

        @Parameter(defaultValue="${session}",
                   required=true,
                   readonly=true)
        protected org.apache.maven.execution.MavenSession mavenSession
        The current build mavenSession instance.
      • useSchemaReferencesForAvsc

        @Parameter(name="useSchemaReferencesForAvsc",
                   defaultValue="false")
        protected boolean useSchemaReferencesForAvsc
        This option will use schema references when writing schemas that depend of schemas from other projects, instead of baking them in. by default (false) all schema references will be inlined.
      • schemaArtifactClassifier

        @Parameter(name="schemaArtifactClassifier",
                   defaultValue="avsc")
        protected String schemaArtifactClassifier
        the schema artifact classifier.
      • schemaArtifactExtension

        @Parameter(name="schemaArtifactExtension",
                   defaultValue="jar")
        protected String schemaArtifactExtension
        the schema artifact extension.
      • repoSystem

        @Component
        protected org.eclipse.aether.RepositorySystem repoSystem
        The entry point to Aether, i.e. the component doing all the work.
    • Constructor Detail

      • SchemaPackageMojo

        public SchemaPackageMojo()
    • Method Detail

      • getSourceFiles

        public String[] getSourceFiles()
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Children must call this. package schemas and sources.s
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • toString

        public String toString()
        will be overwritten as needed, and override will include this result.
      • getRepoSystem

        public final org.eclipse.aether.RepositorySystem getRepoSystem()
      • getMavenSession

        public final org.apache.maven.execution.MavenSession getMavenSession()
      • getMavenProject

        public final org.apache.maven.project.MavenProject getMavenProject()
      • getGeneratedAvscTarget

        public final File getGeneratedAvscTarget()
      • getTarget

        public final File getTarget()