Class CreateExtensionMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.quarkus.maven.CreateExtensionMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="create-extension", requiresProject=false) public class CreateExtensionMojo extends org.apache.maven.plugin.AbstractMojo
Creates the base of a Quarkus Extension in different layout depending on the options and environment.

Create in the quarkus-parent project directory (or the extensions parent dir)


It will:
  • generate the new Quarkus extension in the extensions parent as a module (parent, runtime and deployment), with unit test and devmode test on option.
  • On option, generate the new integration test in the integration tests parent as a module.
  • add the dependencies to the bom/application/pom.xml.

Creating a Quarkiverse extension


When using -DgroupId=io.quarkiverse.[featureId], the new extension will use the Quarkiverse layout.

Creating a standalone extension


  • generate the new Quarkus extension in the current directory (parent, runtime and deployment), with unit test and devmode test on option.
  • On option, generate the new integration test module in the current directory.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) String
    Used to detect legacy command usage and display an error
    (package private) File
    Directory where the changes should be performed.
    (package private) String
    The extensionDescription of the runtime module.
    (package private) String
    extensionId of this extension (REQUIRED).
    (package private) String
    The extensionName of the runtime module.
    (package private) String
    The groupId for the newly created Maven modules (REQUIRED - INHERITED IN QUARKUS-CORE).
    (package private) String
    A prefix common to all extension artifactIds in the current source tree.
    (package private) String
    A prefix common to all extension names in the current source tree.
    (package private) String
    Base package under which classes should be created in Runtime and Deployment modules.
    protected org.apache.maven.project.MavenProject
     
    (package private) String
    The artifactId of the Quarkus platform BOM.
    (package private) String
    The groupId of the Quarkus platform BOM.
    (package private) String
    The version of the Quarkus platform BOM.
    (package private) String
    Quarkus version the newly created extension should depend on (REQUIRED - INHERITED IN QUARKUS-CORE).
    (package private) org.eclipse.aether.impl.RemoteRepositoryManager
     
    (package private) List<org.eclipse.aether.repository.RemoteRepository>
     
    (package private) org.eclipse.aether.RepositorySystemSession
     
    (package private) org.eclipse.aether.RepositorySystem
     
    (package private) String
    The version for the newly created Maven modules.
    (package private) boolean
    Indicates whether to generate an extension codestart
    (package private) boolean
    Indicates whether to generate a devmode test for the extension
    (package private) boolean
    Indicates whether to generate an integration tests for the extension
    (package private) boolean
    Indicates whether to generate any tests for the extension (same as -DwithoutUnitTest -DwithoutIntegrationTest -DwithoutDevModeTest)
    (package private) boolean
    Indicates whether to generate a unit test class for the extension

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     

    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 Details

    • basedir

      @Parameter(property="basedir") File basedir
      Directory where the changes should be performed.

      Default: the current directory of the current Java process.
    • extensionId

      @Parameter(property="extensionId") String extensionId
      extensionId of this extension (REQUIRED).

      It will be used to generate the different extension modules artifactIds ([namespaceId][extensionId]-parent), runtime ([namespaceId][extensionId]) and deployment ([namespaceId][extensionId]-deployment).
    • groupId

      @Parameter(property="groupId") String groupId
      The groupId for the newly created Maven modules (REQUIRED - INHERITED IN QUARKUS-CORE).
    • quarkusVersion

      @Parameter(property="quarkusVersion") String quarkusVersion
      Quarkus version the newly created extension should depend on (REQUIRED - INHERITED IN QUARKUS-CORE).
    • namespaceId

      @Parameter(property="namespaceId") String namespaceId
      A prefix common to all extension artifactIds in the current source tree.

      Default: "quarkus-" in quarkus Quarkus Core and Quarkiverse else ""
    • version

      @Parameter(property="version") String version
      The version for the newly created Maven modules.

      Default: automatic in Quarkus Core else CreateExtension.DEFAULT_VERSION
    • extensionName

      @Parameter(property="extensionName") String extensionName
      The extensionName of the runtime module. The extensionNames of the extension parent and deployment modules will be based on this name too.

      Default: the formatted extensionId
    • extensionDescription

      @Parameter(property="extensionDescription") String extensionDescription
      The extensionDescription of the runtime module.

      This description is used on https://code.quarkus.io/.
    • namespaceName

      @Parameter(property="namespaceName") String namespaceName
      A prefix common to all extension names in the current source tree.

      Default: "quarkus-" in Quarkus Core and Quarkiverse else ""
    • packageName

      @Parameter(property="packageName") String packageName
      Base package under which classes should be created in Runtime and Deployment modules.

      Default: auto-generated out of groupId, namespaceId and extensionId
    • quarkusBomGroupId

      @Parameter(property="quarkusBomGroupId") String quarkusBomGroupId
      The groupId of the Quarkus platform BOM.

      Default: CreateExtension.DEFAULT_BOM_GROUP_ID
    • quarkusBomArtifactId

      @Parameter(property="quarkusBomArtifactId") String quarkusBomArtifactId
      The artifactId of the Quarkus platform BOM.

      Default: CreateExtension.DEFAULT_BOM_ARTIFACT_ID
    • quarkusBomVersion

      @Parameter(property="quarkusBomVersion") String quarkusBomVersion
      The version of the Quarkus platform BOM.

      Default: CreateExtension.DEFAULT_BOM_VERSION
    • withCodestart

      @Parameter(property="withCodestart") boolean withCodestart
      Indicates whether to generate an extension codestart
    • withoutUnitTest

      @Parameter(property="withoutUnitTest") boolean withoutUnitTest
      Indicates whether to generate a unit test class for the extension
    • withoutIntegrationTests

      @Parameter(property="withoutIntegrationTests") boolean withoutIntegrationTests
      Indicates whether to generate an integration tests for the extension
    • withoutDevModeTest

      @Parameter(property="withoutDevModeTest") boolean withoutDevModeTest
      Indicates whether to generate a devmode test for the extension
    • withoutTests

      @Parameter(property="withoutTests") boolean withoutTests
      Indicates whether to generate any tests for the extension (same as -DwithoutUnitTest -DwithoutIntegrationTest -DwithoutDevModeTest)
    • artifactId

      @Parameter(property="artifactId") String artifactId
      Used to detect legacy command usage and display an error
    • project

      @Parameter(defaultValue="${project}") protected org.apache.maven.project.MavenProject project
    • repos

      @Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true, required=true) List<org.eclipse.aether.repository.RemoteRepository> repos
    • repoSession

      @Parameter(defaultValue="${repositorySystemSession}", readonly=true) org.eclipse.aether.RepositorySystemSession repoSession
    • repoSystem

      @Component org.eclipse.aether.RepositorySystem repoSystem
    • remoteRepoManager

      @Component org.eclipse.aether.impl.RemoteRepositoryManager remoteRepoManager
  • Constructor Details

    • CreateExtensionMojo

      public CreateExtensionMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException