Skip to content

sdkman/sdkman-vendor-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Plugin for SDKMAN!

Build Status Download


The SDKMAN! Maven Plugin.

Release a new Candidate Version

Usage in a pom.xml:

<plugin>
  <groupId>io.sdkman</groupId>
  <artifactId>sdkman-maven-plugin</artifactId>
  <version>2.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>release</goal>
      </goals>
      <phase>deploy</phase>
      <configuration>
        <apiHost>the-api-host</apiHost>
        <candidate>the-candidate</candidate>
        <version>the-version</version>
        <url>the-url</url>
      </configuration>
    </execution>
  </executions>
</plugin>

The consumerKey and consumerToken could also be specified in the configuration tag but these should not be there. These values have corresponding properties that should be used from the command line or configured in the settings.xml.

The apiHost specifies the SDKMAN! server to use, the default value is vendors.sdkman.io.

Usage from command line:

mvn -e io.sdkman:sdkman-maven-plugin:2.0.0:release \
    -Dsdkman.api.host=${api_host} \
    -Dsdkman.consumer.key=${my_key} \
    -Dsdkman.consumer.token=${my_token} \
    -Dsdkman.candidate=${my_candidate} \
    -Dsdkman.version=${my_version} \
    -Dsdkman.url=${my_url}

Set existing Version as Default for Candidate

Usage in a pom.xml:

<plugin>
  <groupId>io.sdkman</groupId>
  <artifactId>sdkman-maven-plugin</artifactId>
  <version>2.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>default</goal>
      </goals>
      <phase>deploy</phase>
      <configuration>
        <apiHost>the-api-host</apiHost>
        <candidate>the-candidate</candidate>
        <version>the-version</version>
      </configuration>
    </execution>
  </executions>
</plugin>

Usage from command line:

mvn -e io.sdkman:sdkman-maven-plugin:2.0.0:default \
    -Dsdkman.api.host=${api_host} \
    -Dsdkman.consumer.key=${my_key} \
    -Dsdkman.consumer.token=${my_token} \
    -Dsdkman.candidate=${my_candidate} \
    -Dsdkman.version=${my_version}

Broadcast a Structured Message

Usage in a pom.xml:

<plugin>
  <groupId>io.sdkman</groupId>
  <artifactId>sdkman-maven-plugin</artifactId>
  <version>2.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>announce</goal>
      </goals>
      <phase>deploy</phase>
      <configuration>
        <apiHost>the-api-host</apiHost>
        <candidate>the-candidate</candidate>
        <version>the-version</version>
        <releaseNotesUrl>my_release_notes_url</releaseNotesUrl>
      </configuration>
    </execution>
  </executions>
</plugin>

Usage from command line:

mvn -e io.sdkman:sdkman-maven-plugin:2.0.0:announce \
    -Dsdkman.api.host=${api_host} \
    -Dsdkman.consumer.key=${my_key} \
    -Dsdkman.consumer.token=${my_token} \
    -Dsdkman.candidate=${my_candidate} \
    -Dsdkman.version=${my_version} \
    -Dsdkman.sdkman.release.notes.url=${my_release_notes_url}

Publish a Minor Release

This is a convenience goal for issuing a release plus an announcement

<plugin>
  <groupId>io.sdkman</groupId>
  <artifactId>sdkman-maven-plugin</artifactId>
  <version>2.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>minor-release</goal>
      </goals>
      <phase>deploy</phase>
      <configuration>
        <apiHost>the-api-host</apiHost>
        <candidate>the-candidate</candidate>
        <version>the-version</version>
        <url>the-url</url>
        <releaseNotesUrl>my_release_notes_url</releaseNotesUrl>
      </configuration>
    </execution>
  </executions>
</plugin>
mvn -e io.sdkman:sdkman-maven-plugin:2.0.0:minor-release \
    -Dsdkman.api.host=${api_host} \
    -Dsdkman.consumer.key=${my_key} \
    -Dsdkman.consumer.token=${my_token} \
    -Dsdkman.candidate=${my_candidate} \
    -Dsdkman.version=${my_version} \
    -Dsdkman.url=${my_url} \
    -Dsdkman.sdkman.release.notes.url=${my_release_notes_url}

Publish a Major Release

This is a convenience goal for issuing a release, announcement, and setting the default version.

<plugin>
  <groupId>io.sdkman</groupId>
  <artifactId>sdkman-maven-plugin</artifactId>
  <version>2.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>major-release</goal>
      </goals>
      <phase>deploy</phase>
      <configuration>
        <apiHost>the-api-host</apiHost>
        <candidate>the-candidate</candidate>
        <version>the-version</version>
        <url>the-url</url>
        <releaseNotesUrl>my_release_notes_url</releaseNotesUrl>
      </configuration>
    </execution>
  </executions>
</plugin>
mvn -e io.sdkman:sdkman-maven-plugin:2.0.0:major-release \
    -Dsdkman.api.host=${api_host} \
    -Dsdkman.consumer.key=${my_key} \
    -Dsdkman.consumer.token=${my_token} \
    -Dsdkman.candidate=${my_candidate} \
    -Dsdkman.version=${my_version} \
    -Dsdkman.url=${my_url} \
    -Dsdkman.sdkman.release.notes.url=${my_release_notes_url}

External configuration

The consumer key/token and the api host can be specified in the settings.xml Maven configuration, most likely with a profile to activate when necessary:

~/.m2/repository/settings.xml
<profiles>
  <id>sdkman</id>
  <profile>
    <sdkman.api.host>the-api-host</sdkman.api.host>
    <sdkman.consumer.key>my-key</sdkman.consumer.key>
    <sdkman.consumer.token>my-token</sdkman.consumer.token>
  </profile>
</profiles>

It can be used activating the sdkman profile.