The Helidon CLI lets you easily create a Helidon project by picking from a set of archetypes.
It also supports a developer loop that performs continuous compilation and application restart, so you can easily iterate over source code changes.
helidon init
Then answer the questions.
cd myproject
helidon dev
As you make source code changes the project will automatically recompile and restart your application.
- impl: implementation of the Helidon CLI. Uses
harness
,codegen
andplugin
- harness: a general purpose CLI harness
- codegen: annotation processor for
harness
- plugin: code that would normally be in
impl
, but to reduce native image bloat it is included as a jar in the native image and executed by extracting the jar on disk and spawning a java process.
Issue #849
and related PR #905 added
a prompt with a list of available Helidon versions to choose from
for Helidon CLI init
command. As a result the previous approach was changed when
user had to choose the default version of Helidon or typed some other one.
The site release creates a latest
file containing the latest Helidon version number:
https://helidon.io/cli-data/latest.
User has to choose the default version of Helidon or types some other one when Helidon CLI init
command is used.
The latest
file was replaced by versions.xml
file that contains information about archetypes versions:
https://helidon.io/cli-data/versions.xml.
User has to choose the version of Helidon from the list of available versions when Helidon CLI init
command is used.
The archetypes used by the CLI (for init
command) are maintained in
the main Helidon repository and published as part of a Helidon release:
https://repo1.maven.org/maven2/io/helidon/archetypes/
The archetypes along with an index are published to Maven as a catalog: https://repo1.maven.org/maven2/io/helidon/archetypes/helidon-archetype-catalog/
As part of the helidon-site build a file called metadata.properies
is generated
that contains information about versions:
- build-tools.version: Version of
helidon-maven-plugin
to use. Only used by CLI versions 2.0.2 and earlier. - cli.version: Version of the latest CLI binaries. Used to determine if there is an upgrade available.
- cli.latest.plugin.version: Version of the
helidon-cli-maven-plugin
to use for versions > 2.0.2
Note that the last two can be different if, for example, we choose to release CLI binaries without doing a full build-tools release.
The site build bundles metadata.properties
along with the archetype catalog into cli-data.zip
.
This file is hosted on helidon.io. For example: https://helidon.io/cli-data/2.2.2/cli-data.zip
If needed the CLI downloads cli-data.zip
and extracts the data into ~/.helidon/cache
.
It now has access to the archetype catalog from the local disk.
When the cli starts up it determines the version of Helidon to use. The user might have passed the version, or the CLI might use the latest by inspecting https://helidon.io/cli-data/latest.
When the cli starts up it inspects https://helidon.io/cli-data/versions.xml and gets information about all available versions of Helidon. After that it proposes to the user the latest major versions of Helidon and the default one. User can choose one of them or look at all available versions and choose the required one.
Configuration for the cli is stored in ~/.helidon/config
.