- Hands-On Full Stack Development with Spring Boot 2.0 and React
- Juha Hinkula
- 386字
- 2021-06-25 21:00:21
The basics of Eclipse and Maven
Eclipse is an IDE for multiple programming languages, such as Java, C++, and Python. Eclipse contains different perspectives for your needs. A perspective is a set of views and editors in the Eclipse Workbench. The following screenshot shows common perspectives for Java development:

On the left side, we have Project Explorer, where we can see our project structure and resources. Project Explorer is also used to open files by double-clicking on them. The files will be opened in the editor, that is located in the middle of the workbench. The Console view can be found in the lower section of the workbench. The Console view is really important because it shows application logging messages.
You can get the Spring Tool Suite (STS) for Eclipse if you want, but we are not going to use it in this book because the plain Eclipse installation is enough for our purposes. STS is a set of plugins that makes Spring application development easier (https://spring.io/tools).
Apache Maven is a software project management tool. The basis of Maven is the project object model (pom). Maven makes the software development process easier and it also unifies the development process. You can also use another project management tool called Gradle with Spring Boot, but in this book, we will focus on using Maven.
The pom is a pom.xml file that contains basic information about the project. There are also all the dependencies that Maven should download to be able to build the project.
Basic information about the project can be found at the beginning of the pom.xml file, which defines, for example, the version of the application, packaging format, and so on.
The minimum version of the pom.xml file should contain the project root, modelVersion, groupId, artifactId, and version.
Dependencies are defined inside the dependencies section, as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.packt</groupId>
<artifactId>cardatabase</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cardatabase</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Maven is normally used from the command line. Eclipse contains embedded Maven, and that handles all the Maven operations we need. Therefore, we are not focusing on Maven command-line usage here. The most important thing is to understand the structure of the pom.xml file and how to add new dependencies to it.
- 從零開始構建企業級RAG系統
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- 深入理解Java7:核心技術與最佳實踐
- TypeScript圖形渲染實戰:基于WebGL的3D架構與實現
- ASP.NET Core 2 Fundamentals
- Creating Stunning Dashboards with QlikView
- HTML5 APP開發從入門到精通(微課精編版)
- C專家編程
- 持續集成與持續交付實戰:用Jenkins、Travis CI和CircleCI構建和發布大規模高質量軟件
- 區塊鏈國產化實踐指南:基于Fabric 2.0
- Web Developer's Reference Guide
- 奔跑吧 Linux內核
- Python預測分析與機器學習
- Python數據科學實踐指南
- ASP.NET本質論