이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 2. Creating the Spring Web example Maven project
You can create a new Quarkus project, automatically generate the REST controller class, and add the quarkus-spring-web dependency with a single command using the Quarkus Maven plugin. You can also update the pom.xml file and create the REST controller class and the REST controller test class manually.
Procedure
Use one of the following approaches that are shown shown in this section to create your Quarkus Spring Web example Maven project:
If you do not have a Maven project, you can create a new Maven project using the Quarkus Maven plugin. Enter the following command to:
- Create the Maven project directory structure
-
Create the
org.acme.spring.web.GreetingControllerclass that defines a REST endpoint for your application Import the
quarkus-spring-webextensionYou must replace
<project_name>with the name of the directory that contains your project files.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
If you already have a Quarkus Maven project, you must add the
quarkus-spring-webextension to it using the command line:
Navigate to the root directory of your project:
cd <project_name>
cd <project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
quarkus-spring-webextension to thepom.xmlfile of your project:./mvnw quarkus:add-extension -Dextensions="spring-web"
./mvnw quarkus:add-extension -Dextensions="spring-web"Copy to Clipboard Copied! Toggle word wrap Toggle overflow With this command you add the following entry to your
pom.xmlfile:pom.xml
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-spring-web</artifactId> </dependency><dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-spring-web</artifactId> </dependency>Copy to Clipboard Copied! Toggle word wrap Toggle overflow