scalamojo-maven-plugin

The scalamojo-maven-plugin is an extension of the maven-plugin-plugin plugin report to decorate mojo descriptors extracted by the Maven Plugin Tool for Annotations with additional mojo and parameter details extracted from scaladoc: description, @since, and @deprecated.

If there are problems please let me know.

Requirements

Supported Annotations

package org.example.mojo

import org.apache.maven.execution.MavenSession
import org.apache.maven.plugin.AbstractMojo
import org.apache.maven.plugin.MojoExecution
import org.apache.maven.plugin.descriptor.PluginDescriptor
import org.apache.maven.plugins.annotations.ResolutionScope
import org.apache.maven.plugins.annotations.Component
import org.apache.maven.plugins.annotations.Execute
import org.apache.maven.plugins.annotations.InstantiationStrategy
import org.apache.maven.plugins.annotations.LifecyclePhase
import org.apache.maven.plugins.annotations.Mojo
import org.apache.maven.plugins.annotations.Parameter
import org.apache.maven.project.MavenProject
import org.apache.maven.settings.Settings

/**
 * Mojo Description. @Mojo( name = "<goal-name>" ) is the minimal required annotation.
 * @since <since-text>
 * @deprecated <deprecated-text>
 */
@Mojo(  name = "<goal-name>",
        aggregator = <false|true>,
        configurator = "<role hint>",
        executionStrategy = "<once-per-session|always>",
        inheritByDefault = <true|false>,
        instantiationStrategy = InstantiationStrategy.<strategy>,
        defaultPhase = "<phase-name>",
        requiresDependencyResolution = ResolutionScope.<scope>,
        requiresDependencyCollection = ResolutionScope.<scope>, // (since Maven 3.0)
        requiresDirectInvocation = <false|true>,
        requiresOnline = <false|true>,
        requiresProject = <true|false>,
        requiresReports = <false|true>, // (unsupported since Maven 3.0)
        threadSafe = <false|true> ) // (since Maven 3.0)
@Execute(   goal = "<goal-name>",
            phase = LifecyclePhase.<phase>
            lifecycle = "<lifecycle-id>" )
class MyMojo extends AbstractMojo {
    /**
     * @since <since-text>
     * @deprecated <deprecated-text>
     */
    @Parameter( alias = "myAlias",
                property = "a.property",
                defaultValue = "an expression with ${variables} eventually",
                readonly = <false|true>
                required = <false|true> )
    var parameter: String = null

    @Component( role = classOf[MyComponentExtension],
                hint = "..." )
    var component: MyComponent = null

    @Component
    var session: MavenSession = null

    @Component
    var project: MavenProject = null

    @Component
    var mojo: MojoExecution = null

    @Component // for Maven 3 only
    var plugin: PluginDescriptor = null

    @Component
    var settings: Settings = null

    def execute() {
      ...
    }
}