Search code examples
mavenpluginsprefix

Maven: how to find the plugin prefix for github-release-plugin


I want to use this maven plugin: https://github.com/jutzig/github-release-plugin

Here is the POM configuration:

<plugin>
    <groupId>de.jutzig</groupId>
    <artifactId>github-release-plugin</artifactId>
    <version>1.1.0</version>
    <executions>
        <execution>
            <id>github-upload</id>
            <phase>deploy</phase>
            <goals>
                <goal>release</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
                <releaseName>${project.version}</releaseName>
                <tag>Initial Release</tag>
                <artifact>${project.build.directory}/${assemblyName}.zip</artifact>
            </configuration>
        </execution>
    </executions>
</plugin>

The question is how to call the release goal from the command line?

I tried: mvn github-release-plugin:release

This fails with: No plugin found for prefix 'github-release-plugin' in the current project and in the plugin groups

I'm fairly new to maven and wonder how to find out the correct prefix needed for this plugin.


Solution

  • Try this:

    mvn de.jutzig:github-release-plugin:1.1.0:release

    Checkout the Executing Your First Mojo section here‌​. It also mentions a few tips on reducing the verboseness of the command, one of which is 'Attaching the Mojo to the Build Lifecycle', which you've done anyway - you just gotta take advantage of it by running:

    mvn deploy

    Read about the maven lifecycles to understand the various phases and how you can bind goals to a specific phase in a lifecycle here.