-
Notifications
You must be signed in to change notification settings - Fork 5
Home
The following pages will give a detailed overview over the basic concepts and their implementations as well as some usage examples and suggestions.
Simply add the following dependency to your Maven plugin and start implementing your Mojos.
<dependency>
<groupId>com.itemis.maven.plugins</groupId>
<artifactId>cdi-plugin-utils</artifactId>
<version>3.1.2</version>
</dependency>
Your Mojos must extend the abstract class com.itemis.maven.plugins.cdi.AbstractCDIMojo
and must not override the method execute() since this method is implemented by the base class and which will bootstrap the dependency injection container at this point.
There are some Mojo parameters that are implicitly available for all Mojos when extending AbstractCDIMojo. Currently the list of parameters comprises the following ones:
Parameter Name | User Property Name | Type | Default Value | Required | Description |
---|---|---|---|---|---|
enableLogTimestamps | enableLogTimestamps | boolean | true |
false | Enables timestamped logging output. The logger can be retrieved by injecting either org.apache.maven.plugin.logging.Log or com.itemis.maven.plugins.cdi.logging.MavenLogWrapper . |
workflowDescriptor | workflowDescriptor | File | - |
false | This is the parameter for overriding the default workflow of the Mojo. Set the path of your custom workflow file here. |
Besides the implicit Mojo parameters there are also some implicit switches available for all Mojos that extend the AbstractCDIMojo. These switches are mainly used to provide some meta-information about the Mojo such as the workflow. Those switches can only be activated using system properties (-D...) and are not part of the actual Mojo configuration.
There are currently the following switches available:
Switch | Allowed Values | Feature Description |
---|---|---|
printWorkflow | ANY (value not considered) | Prints the default workflow of the Mojo (more info). |
printSteps | ANY (value not considered) | Prints all Processing steps that are available on classpath. These steps can be used to customize the workflow (more info). |
- Getting Started
- Apache Maven
- Apache Maven - Guide to Developing Java Plugins
- CDI Spec (Weld)
- Unleash Maven Plugin: An alternative Maven release plugin basing on this library.
- Unleash SCM Provider Git and Unleash SCM Provider SVN: The SCM implementations for the unleash plugin that can be added to the plugin classpath. The required implementation will then be injected dynamically at runtime using CDI.
- CDI Plugin Hooks: A collection of some standard hook implementations that you can add to the classpath of your plugin. You can then use these hooks to customize the workflow.
© 2016 itemis AG