Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 3.91 KB

README.md

File metadata and controls

76 lines (59 loc) · 3.91 KB

moby-names-generator-java

Build Status Quality Gate Status Coverage Technical Debt

Java Version of the famous Moby (Docker) Names Generator.

import info.schnatterer.mobynamesgenerator.MobyNamesGenerator;

class GenerateMobyName {
    public static void main(String[] args) {
        System.out.println(MobyNamesGenerator.getRandomName());
    }
}

Also available as CLI. Screencast showcasing Docker Image

Usage

Add the latest stable version of moby-names-generator to the dependency management tool of your choice.

<dependency>
  <groupId>info.schnatterer.moby-names-generator</groupId>
  <artifactId>moby-names-generator</artifactId>
  <version>20.10.0-r0</version>
</dependency>

Maven Central

You can also get snapshot versions from our snapshot repository (for the most recent commit). To do so, add the following repo to your pom.xml or settings.xml:

<repository>
    <id>snapshots-repo</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases><enabled>false</enabled></releases>
    <snapshots><enabled>true</enabled></snapshots>
</repository>

Demo/CLI

There are examples for Java 8 and Java9+ (using Jigsaw/JPMS). Both implement simple command line interfaces that return a random name.

The Java 9+ example is also available as compact Docker image, built using GraalVM.

moby-names-generator on DockerHub

$ docker run --rm schnatterer/moby-names-generator
nifty_noether

Releasing

The version name looks like so, for example: 20.10.0-r0-SNAPSHOT The first part (before -r0) corresponds to the moby version. The second part r0 is zero-based and can be increase when the moby version does not change. When updating the moby version, use a snapshot first, to see if the builds still succeeds.

  • Set the version using: mvn versions:set
  • When the builds succeed, release either via
    • ./mvnw release:prepare -Darguments=pgp.skip=true Sets versions in pom.xml, commits, tags and pushes to SCM. Travis builds tag and pushes to Maven Central.
    • Or manually using mvn versions:set to set version without SNAPSHOT, then increase r and add SNAPSHOT again. Don't forget to tag. Either locally or via GitHub (signed tag!)