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.