Skip to content

Allows you to define a project that produces the binary for a command-line based application, using the Assembly plug-in.

Notifications You must be signed in to change notification settings

marco-brandizi/cli-archetype

 
 

Repository files navigation

The Command Line Archetype

This is a Maven Archetype project, to create Maven project that produce command line packages.

You can easily generate a new project (ie, Maven module) from a Bash-compatible shell, by typing something like:

create_cli_url="https://raw.githubusercontent.com/marco-brandizi/cli-archetype/master/create-project.sh"  	
curl -L "$create_cli_url" | sh -s sampleGroupId sample-cli 1.0-SNAPSHOT

where, of course, the three parameters are the new artifact's coordinates.

This generates a new basic CLI project, which includes:

  • an entry point class, which contains a main() implementation that parses the command line arguments by means of the picocli library. Examples showing how to define possible options and parse them with this library is shown.

  • A unit test for the entry point, which you can customise according to your needs.

  • Definitions based on the Maven Assembly plug-in to put a distribution zip together. This includes a Bash launching script (Windows not available yet). The zip-deploy.sh script helps you to deploy the distro zip to some target directory.

  • You can read more about this project on this blog post.

Note: the create-project.sh script mentioned above creates a new project based on the latest (usually snapshot) version of the archetype POM. Change the script manually if you want to use another version.

About

Allows you to define a project that produces the binary for a command-line based application, using the Assembly plug-in.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 52.5%
  • Shell 47.5%