官术网_书友最值得收藏!

  • Cloud-Native Applications in Java
  • Ajay Mahajan Munish Kumar Gupta Shyam Sundar
  • 241字
  • 2021-06-24 19:07:16

Creating a Maven project

Open your IDE (Eclipse Neon or other) and then create a new Maven project as follows:

  1. Right-click on Package Explorer and select New and Project..., as shown in the following screenshot:
  1. Select Maven Project:
  1. In the next window of the wizard, choose Create a simple project.
  1. The next dialog will ask for many parameters. Of these, the Group Id (what your project name is) and the Artifact Id (application or service name) are important. Select reasonable names, as shown in the following screenshot:
  1. Select Finish. You should see the following structure:

If the JRE System Library [JavaSE-1.6] does not exist, or you have a later version, go to the project properties and edit it to select the version that your Eclipse is configured with. You do this by changing the Properties by right-clicking JRE System Library [JavaSE-1.6]. Here's a screenshot after adjusting the JRE System Library to 1.8.

  1. Now, you have a clean slate. Open the Maven file pom.xml and add a dependency to the spring-boot-starter-web. This will tell Spring Boot to configure this project to get libraries for web development:
<project xmlns.... 
  <modelVersion>4.0.0</modelVersion> 
  <parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.4.3.RELEASE</version> 
  </parent> 
  <groupId>com.mycompany.petstore</groupId> 
  <artifactId>product</artifactId> 
  <version>0.0.1-SNAPSHOT</version>    
<dependencies> 
    <dependency> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 
</dependencies> 
</project> 

When you save this POM file, your IDE will build the workspace and download the dependent libraries, assuming your internet connection works (directly or through a proxy as configured before), and you are all set to develop the service.

主站蜘蛛池模板: 隆子县| 平山县| 元氏县| 荥阳市| 大洼县| 峨边| 淮阳县| 苏尼特左旗| 玉环县| 天峻县| 深水埗区| 沿河| 无锡市| 大关县| 鄢陵县| 浙江省| 北安市| 靖江市| 陆丰市| 林芝县| 贵定县| 湛江市| 玉山县| 建湖县| 四子王旗| 连城县| 雅安市| 荥阳市| 上虞市| 安乡县| 湖州市| 漳平市| 镇坪县| 柘荣县| 利川市| 新邵县| 扶风县| 乐都县| 高邑县| 阳原县| 育儿|