第5章 Spring Boot イメージのアプリケーションの開発
本章では、Spring Boot イメージのアプリケーションを開発する方法を説明します。
5.1. Maven archetype を使用した Spring Boot プロジェクトの作成 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Maven archetype を使用して Spring Boot プロジェクトを作成するには、以下の手順にしたがいます。
手順
- システムの適切なディレクトリーに移動します。
シェルプロンプトで以下の
mvnコマンドを入力し、Spring Boot プロジェクトを作成します。mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \ -DarchetypeCatalog=https://maven.repository.redhat.com/ga/io/fabric8/archetypes/archetypes-catalog/2.2.0.fuse-740017-redhat-00003/archetypes-catalog-2.2.0.fuse-740017-redhat-00003-archetype-catalog.xml \ -DarchetypeGroupId=org.jboss.fuse.fis.archetypes \ -DarchetypeArtifactId=spring-boot-camel-xml-archetype \ -DarchetypeVersion=2.2.0.fuse-740017-redhat-00003archetype プラグインが対話モードに切り替わり、残りのフィールドの入力を要求されます。
Define value for property 'groupId': : org.example.fis Define value for property 'artifactId': : fuse74-spring-boot Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': org.example.fis: : [INFO] Using property: spring-boot-version = 1.5.17.RELEASE Confirm properties configuration: groupId: org.example.fis artifactId: fuse74-spring-boot version: 1.0-SNAPSHOT package: org.example.fis spring-boot-version: 1.5.17.RELEASE Y: :プロンプトが表示されたら、
groupId値にorg.example.fisを入力し、artifactId値にfuse74-Spring-boot を入力します。残りのフィールドにはデフォルト値を使用します。- サンプルのビルドおよびデプロイ方法については、クイックスタートの手順にしたがいます。
注記
使用できる Spring Boot archetype の完全リストは、Spring Boot archetype カタログ を参照してください。