- 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:
- Right-click on Package Explorer and select New and Project..., as shown in the following screenshot:

- Select Maven Project:
- In the next window of the wizard, choose Create a simple project.
- 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:

- 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.

- 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.
推薦閱讀
- 電力線通信技術(shù)
- 元器件易學(xué)通:常用元件分冊(cè)
- Serverless架構(gòu):無(wú)服務(wù)器應(yīng)用與AWS Lambda
- 彩色電視機(jī)現(xiàn)場(chǎng)維修實(shí)錄
- 深入理解Android:Java虛擬機(jī)ART
- 等離子彩電維修代換技法揭秘
- 數(shù)據(jù)鏈理論與系統(tǒng)
- 室內(nèi)定位理論、方法和應(yīng)用
- 面向5G的智能光承載網(wǎng)規(guī)劃與運(yùn)維實(shí)踐
- SMT工藝與PCB制造(電子技術(shù)輕松學(xué))
- 電子工程師必備——元器件應(yīng)用寶典
- 光波分復(fù)用系統(tǒng)與維護(hù)
- 電子技術(shù)及應(yīng)用(第2版)
- 5G改變世界
- Kamailio實(shí)戰(zhàn)