Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's micronaut-cli.yml for?

Tags:

micronaut

When I generate a new Micronaut project using the mn CLI tool or Micronaut Launch, it comes with a micronaut-cli.yml file specifying an applicationType, defaultPackage, testFramework, sourceLanguage, buildTool, and features. Yet if I delete this file, alter it, or even replace it with invalid YAML, my project still seems to build and run just fine.

Presumably the mn CLI itself can't possibly use this file for anything either, since it looks like it only supports project creation commands - nothing for editing existing projects. At least, I only see those when I run mn --help in my home directory.

So what's micronaut-cli.yml for? Does it actually affect anything at all? Or is it just a historical record of how the project was created?

like image 726
Mark Amery Avatar asked Sep 11 '25 12:09

Mark Amery


1 Answers

Presumably the mn CLI itself can't possibly use this file for anything either, since it looks like it only supports project creation commands - nothing for editing existing projects.

It isn't true that the CLI itself can't possibly use the file. It does. It also isn't true that the cli only supports project creation commands. The CLI supports other commands. To see a list of commands available in your project, run mn --help from inside the directory containing the micronaut-cli.yml file.

So what's micronaut-cli.yml for?

It is a config file for the CLI.

Does it actually affect anything at all? Or is it just a historical record of how the project was created?

The former.

As an example set testFramework to junit and run create-test. Then change testFramework to spock and run the same command.

like image 82
Jeff Scott Brown Avatar answered Sep 13 '25 14:09

Jeff Scott Brown