Micronaut CLI is very useful while creating the application, however the command to create a controller is not present in the CLI.
Micronaut Version: 2.0.3
From the micronaut documentation we have a command for profile https://docs.micronaut.io/2.0.0.M3/guide/index.html#cli
$ mn profile-info service
Profile: service
------------------
The service profile
Provided Commands:
--------------------
create-bean Creates a singleton bean
create-client Creates a client interface
create-controller Creates a controller and associated test
create-job Creates a job with scheduled method
create-test Creates a simple test for the project's testing framework
create-websocket-client Creates a Websocket client
create-websocket-server Creates a Websocket server
help Prints help information for a specific command
Provided Features:
------------------
...
When I run the command mn profile-info service
I get an error as
I have only below options
I am trying to create a controller from the cli
Profiles were only in Micronaut version 1.x. So profile related commands like
mn profile-info service
are not available in Micronaut version 2.x.When you create the project end enter the project directory you can use these additional
mn
commands:feature-diff
- Produces the diff of an original project with an original project with additional features.create-job
- Creates a job with scheduled methodcreate-client
- Creates a client interfacecreate-controller
- Creates a controller and associated testcreate-test
- Creates a simple test for the project's testing frameworkcreate-bean
- Creates a singleton beancreate-websocket-client
- Creates a Websocket clientcreate-websocket-server
- Creates a Websocket serverAnd you can also see more description of the command when you call it with
-h
option. For example: