Class CommandLineMojo

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

    @Mojo(name="cli",
          requiresProject=true,
          defaultPhase=VALIDATE)
    public final class CommandLineMojo
    extends org.apache.maven.plugin.AbstractMojo
    Maven Goal to run spec verifications from the command line.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String apiJar
      Path to the API jar file.
      private java.lang.String apiPackage
      API package.
      private static java.io.Console cons
      The system console.
      private boolean help
      Show the usage.
      private java.lang.String implBuild
      Implementation build.
      private java.lang.String implJar
      Path to the Impl jar file.
      private java.lang.String implNamespace
      Implementation namespace.
      private java.lang.String implVersion
      Implementation version.
      private boolean isFinal
      Is it a final specification?.
      private java.lang.String jarType
      Is it an API jar?.
      private java.lang.String newImplVersion
      New implementation version.
      private java.lang.String newSpecVersion
      New spec version.
      private java.io.File properties
      Property file.
      private java.lang.String specBuild
      Spec build.
      private java.lang.String specImplVersion
      Spec implementation version.
      private java.lang.String specMode
      Mode.
      private java.lang.String specVersion
      Spec version.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandLineMojo()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      private static void fail​(java.lang.String msg)
      Print error and exit.
      private static void printParam​(java.lang.String arg, java.lang.String desc)
      Print a given parameter to the standard output.
      private static java.lang.String prompt​(java.lang.String msg)
      Prompt with the string and return the user's input.
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • isFinal

        @Parameter(property="isFinal",
                   defaultValue="false")
        private boolean isFinal
        Is it a final specification?.
      • jarType

        @Parameter(property="isApi",
                   defaultValue="true")
        private java.lang.String jarType
        Is it an API jar?.
      • apiJar

        @Parameter(property="apijar")
        private java.lang.String apiJar
        Path to the API jar file.
      • implJar

        @Parameter(property="impljar")
        private java.lang.String implJar
        Path to the Impl jar file.
      • implNamespace

        @Parameter(property="implnamespace")
        private java.lang.String implNamespace
        Implementation namespace.
      • specMode

        @Parameter(property="specMode",
                   defaultValue="jakarta")
        private java.lang.String specMode
        Mode. Allowed values are "javaee", "jakarta"
      • apiPackage

        @Parameter(property="apipackage")
        private java.lang.String apiPackage
        API package.
      • specVersion

        @Parameter(property="specversion")
        private java.lang.String specVersion
        Spec version.
      • specImplVersion

        @Parameter(property="specimplversion")
        private java.lang.String specImplVersion
        Spec implementation version.
      • implVersion

        @Parameter(property="implversion")
        private java.lang.String implVersion
        Implementation version.
      • newImplVersion

        @Parameter(property="newimplversion")
        private java.lang.String newImplVersion
        New implementation version.
      • newSpecVersion

        @Parameter(property="newspecversion")
        private java.lang.String newSpecVersion
        New spec version.
      • specBuild

        @Parameter(property="specbuild")
        private java.lang.String specBuild
        Spec build.
      • implBuild

        @Parameter(property="implbuild")
        private java.lang.String implBuild
        Implementation build.
      • properties

        @Parameter(property="properties")
        private java.io.File properties
        Property file.
      • help

        @Parameter(property="help",
                   defaultValue="true")
        private boolean help
        Show the usage.
      • cons

        private static java.io.Console cons
        The system console.
    • Constructor Detail

      • CommandLineMojo

        public CommandLineMojo()
    • Method Detail

      • prompt

        private static java.lang.String prompt​(java.lang.String msg)
        Prompt with the string and return the user's input.
        Parameters:
        msg - the prompt message
        Returns:
        the user input
      • fail

        private static void fail​(java.lang.String msg)
        Print error and exit.
        Parameters:
        msg - the error message
      • printParam

        private static void printParam​(java.lang.String arg,
                                       java.lang.String desc)
        Print a given parameter to the standard output.
        Parameters:
        arg - the parameter
        desc - the description
      • 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