[JAVA] Profils et fonctionnalités de la CLI Micronaut

Micronaut CLI? Micronaut CLI est un outil CLI fourni par Micronaut (manma).

Micronaut CLI

The Micronaut CLI is the recommended way to create new Micronaut projects.

Lors de la création d'un nouveau projet Micronaut, il est recommandé d'utiliser cette CLI Micronaut.

Features?

À propos, lorsque vous utilisez CLI avec Micronaut, vous pouvez spécifier --features comme suit.

Par exemple, si vous souhaitez créer un projet pour Groovy.

$ mn create-app hello-world-groovy --build maven --features=groovy

Quelles sont les «--features» qui peuvent être spécifiées ici? Alors j'ai cherché.

environnement

Cet environnement est ici.

$ mn -V
| Micronaut Version: 1.0.4
| JVM Version: 1.8.0_191

Profils et fonctionnalités

Tout d'abord, comment vérifier.

Features

Exécutez la commande profile-info de la CLI Micronaut avec le profil spécifié.

Il existe deux profils, «service» et «fonction».

Pour le profil service.

$ 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-websocket-client  Creates a Websocket client
  create-websocket-server  Creates a Websocket server
  help                  Prints help information for a specific command

| Provided Features:
--------------------
  annotation-api        Adds Java annotation API
  cassandra             Adds support for Cassandra in the application
  config-consul         Adds support for Distributed Configuration with Consul (https://www.consul.io)
  discovery-consul      Adds support for Service Discovery with Consul (https://www.consul.io)
  discovery-eureka      Adds support for Service Discovery with Eureka
  graal-native-image    Allows Building a Native Image
  groovy                Creates a Groovy application
  hibernate-gorm        Adds support for GORM persistence framework
  hibernate-jpa         Adds support for Hibernate/JPA
  http-client           Adds support for creating HTTP clients
  http-server           Adds support for running a Netty server
  java                  Creates a Java application
  jdbc-dbcp             Configures SQL DataSource instances using Commons DBCP
  jdbc-hikari           Configures SQL DataSource instances using Hikari Connection Pool
  jdbc-tomcat           Configures SQL DataSource instances using Tomcat Connection Pool
  jib                   Adds support for Jib builds
  jrebel                Adds support for class reloading with JRebel (requires separate JRebel installation)
  junit                 Adds support for the JUnit testing framework
  kafka                 Adds support for Kafka
  kafka-streams         Adds support for Kafka Streams
  kotlin                Creates a Kotlin application
  management            Adds support for management endpoints
  micrometer            Adds support for Micrometer metrics
  micrometer-atlas      Adds support for Micrometer metrics (w/ Atlas reporter)
  micrometer-graphite   Adds support for Micrometer metrics (w/ Graphite reporter)
  micrometer-prometheus  Adds support for Micrometer metrics (w/ Prometheus reporter)
  micrometer-statsd     Adds support for Micrometer metrics (w/ Statsd reporter)
  mongo-gorm            Configures GORM for MongoDB for Groovy applications
  mongo-reactive        Adds support for the Mongo Reactive Streams Driver
  neo4j-bolt            Adds support for the Neo4j Bolt Driver
  neo4j-gorm            Configures GORM for Neo4j for Groovy applications
  netflix-archaius      Adds support for Netflix Archaius in the application
  netflix-hystrix       Adds support for Netflix Hystrix in the application
  netflix-ribbon        Adds support for Netflix Ribbon in the application
  picocli               Adds support for command line parsing (http://picocli.info)
  postgres-reactive     Adds support for the Reactive Postgres driver in the application
  rabbitmq              Adds support for RabbitMQ in the application
  redis-lettuce         Configures the Lettuce driver for Redis
  security-jwt          Adds support for JWT (JSON Web Token) based Authentication
  security-session      Adds support for Session based Authentication
  spek                  Adds support for the Spek testing framework
  spock                 Adds support for the Spock testing framework
  springloaded          Adds support for class reloading with Spring-Loaded
  swagger-groovy        Configures Swagger (OpenAPI) Integration for Groovy
  swagger-java          Configures Swagger (OpenAPI) Integration for Java
  swagger-kotlin        Configures Swagger (OpenAPI) Integration for Kotlin
  tracing-jaeger        Adds support for distributed tracing with Jaeger (https://www.jaegertracing.io)
  tracing-zipkin        Adds support for distributed tracing with Zipkin (https://zipkin.io)

Pour le profil fonction.

$ mn profile-info function
| Profile: function
--------------------
The function profile

| Provided Commands:
--------------------
  create-bean  Creates a singleton bean
  create-job   Creates a job with scheduled method
  help         Prints help information for a specific command

| Provided Features:
--------------------
  annotation-api        Adds Java annotation API
  cassandra             Adds support for Cassandra in the application
  config-consul         Adds support for Distributed Configuration with Consul (https://www.consul.io)
  discovery-consul      Adds support for Service Discovery with Consul (https://www.consul.io)
  discovery-eureka      Adds support for Service Discovery with Eureka
  graal-native-image    Allows Building a Native Image
  groovy                Creates a Groovy application
  hibernate-gorm        Adds support for GORM persistence framework
  hibernate-jpa         Adds support for Hibernate/JPA
  http-client           Adds support for creating HTTP clients
  http-server           Adds support for running a Netty server
  java                  Creates a Java application
  jdbc-dbcp             Configures SQL DataSource instances using Commons DBCP
  jdbc-hikari           Configures SQL DataSource instances using Hikari Connection Pool
  jdbc-tomcat           Configures SQL DataSource instances using Tomcat Connection Pool
  jib                   Adds support for Jib builds
  jrebel                Adds support for class reloading with JRebel (requires separate JRebel installation)
  junit                 Adds support for the JUnit testing framework
  kafka                 Adds support for Kafka
  kafka-streams         Adds support for Kafka Streams
  kotlin                Creates a Kotlin application
  management            Adds support for management endpoints
  micrometer            Adds support for Micrometer metrics
  micrometer-atlas      Adds support for Micrometer metrics (w/ Atlas reporter)
  micrometer-graphite   Adds support for Micrometer metrics (w/ Graphite reporter)
  micrometer-prometheus  Adds support for Micrometer metrics (w/ Prometheus reporter)
  micrometer-statsd     Adds support for Micrometer metrics (w/ Statsd reporter)
  mongo-gorm            Configures GORM for MongoDB for Groovy applications
  mongo-reactive        Adds support for the Mongo Reactive Streams Driver
  neo4j-bolt            Adds support for the Neo4j Bolt Driver
  neo4j-gorm            Configures GORM for Neo4j for Groovy applications
  netflix-archaius      Adds support for Netflix Archaius in the application
  netflix-hystrix       Adds support for Netflix Hystrix in the application
  netflix-ribbon        Adds support for Netflix Ribbon in the application
  openfaas              Adds support for OpenFaaS
  picocli               Adds support for command line parsing (http://picocli.info)
  postgres-reactive     Adds support for the Reactive Postgres driver in the application
  rabbitmq              Adds support for RabbitMQ in the application
  redis-lettuce         Configures the Lettuce driver for Redis
  security-jwt          Adds support for JWT (JSON Web Token) based Authentication
  security-session      Adds support for Session based Authentication
  spek                  Adds support for the Spek testing framework
  spock                 Adds support for the Spock testing framework
  springloaded          Adds support for class reloading with Spring-Loaded
  swagger-groovy        Configures Swagger (OpenAPI) Integration for Groovy
  swagger-java          Configures Swagger (OpenAPI) Integration for Java
  swagger-kotlin        Configures Swagger (OpenAPI) Integration for Kotlin
  tracing-jaeger        Adds support for distributed tracing with Jaeger (https://www.jaegertracing.io)
  tracing-zipkin        Adds support for distributed tracing with Zipkin (https://zipkin.io)

Comme ci-dessous

| Provided Features:

À cet endroit, les fonctionnalités disponibles sont alignées.

Quand je regarde Pat, j'ai l'impression de penser "N'est-ce pas pareil?", Mais quand je le regarde, seul le profil function contient le suivant.

  openfaas              Adds support for OpenFaaS

Ainsi, Profile est un modèle de projet, qui est une collection de commandes et de structures pour créer des squelettes tels que les paramètres par défaut et créer des dépendances.

Profiles

Le profil par défaut est «service».

Les commandes étaient clairement différentes.

## service Profile
$ 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-websocket-client  Creates a Websocket client
  create-websocket-server  Creates a Websocket server
  help                  Prints help information for a specific command


## function Profile
$ mn profile-info function
| Profile: function
--------------------
The function profile

| Provided Commands:
--------------------
  create-bean  Creates a singleton bean
  create-job   Creates a job with scheduled method
  help         Prints help information for a specific command

Pour ce profil, GitHub a sa propre organisation.

micronaut-profiles-versions

Pour le moment, service, function et federation sont alignés, donc cela augmentera avec le temps.

Vous savez maintenant ce que vous pouvez spécifier pour --features.

En outre, il semble bon de voir ici aussi.

Micronaut Profiles

Je veux dire, il semble y avoir plus de profils que vous pouvez réellement spécifier.

$ mn list-profiles
| Available Profiles
--------------------
  cli           The cli profile
  federation    The federation profile
  function-aws  The function profile for AWS Lambda
  kafka         The Kafka messaging profile
  profile       A profile for creating new Micronaut profiles
  service       The service profile

Help and Info

Dois-je chercher ici les --features qui sont appliquées à chaque profil par défaut?

https://github.com/micronaut-projects/micronaut-profiles/blob/v1.0.3/service/profile.yml

https://github.com/micronaut-projects/micronaut-profiles/blob/v1.0.3/function-aws/profile.yml

Recommended Posts

Profils et fonctionnalités de la CLI Micronaut
Java version 8 et fonctionnalités ultérieures
Nouvelles fonctionnalités de Java 9 et exemple de code
Fonction CRUD et MVC dans Rails