99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

11.2 添加 Classpath 依賴

2018-08-14 15:06 更新

Spring Boot provides a number of “Starters” that let you add jars to your classpath. Our sample application has already used spring-boot-starter-parent in the parent section of the POM. The spring-boot-starter-parent is a special starter that provides useful Maven defaults. It also provides a dependency-management section so that you can omit version tags for “blessed” dependencies. SpringBoot提供一許多“Starter”,讓您添加jar包到類路徑(classpath)中。 我們例子應用程序在POM文件的parent節(jié)點中使用(繼承)了spring-boot-starter-parent。 spring-boot-starter-parent是一個特殊的“starter”, 提供了有用的Maven默認值。 同時提供了dependency-management,因此您可以省略“blessed”依賴包的SpringBoot提供一許多“Starter”,讓您添加jar包到類路徑(classpath)中。 我們例子應用程序中Pom文件(繼承的)父POM文件中使用了spring-boot-starter-parent。 spring-boot-starter-parent是一個特殊的“starter”, 提供了有用的Maven默認值。 同時還提供了dependency-management節(jié)點,因此您可以(在引用依賴 包時)省略“blessed”依賴的標簽。

Other “Starters” provide dependencies that you are likely to need when developing a specific type of application. Since we are developing a web application, we add a spring-boot-starter-web dependency. Before that, we can look at what we currently have by running the following command: 其他“Starter”提供了您可能在開發(fā)一個特定類型的應用程序時需要的依賴。 由于我們要開發(fā)一個Web應用程序,因此我們添加了spring-boot-starter-web依賴。 在此之前, 我們能看一下當前有的依賴,通過運行以下命令:

$ mvn dependency:tree


[INFO] com.example:myproject:jar:0.0.1-SNAPSHOT

The mvn dependency:tree command prints a tree representation of your project dependencies. You can see that spring-boot-starter-parent provides no dependencies by itself. To add the necessary dependencies, edit your pom.xml and add the spring-boot-starter-web dependency immediately below the parent section:

mvn dependency:tree命令打印了您的以樹形表現(xiàn)的項目依賴。您能夠看見spring-boot-starter-parent本身沒有提供依賴。為添加必需的依賴, 編輯pom.xml,添加mvn dependency:tree命令打印了您的以樹形表現(xiàn)的項目依賴。您能夠看見spring-boot-starter-parent本身沒有提供依賴。為添加必需的依賴, 編輯pom.xml,在緊接著parent節(jié)點后面添加spring-boot-starter-web依賴:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

If you run mvn dependency:tree again, you see that there are now a number of additional dependencies, including the Tomcat web server and Spring Boot itself.

如果您再次運行mvn dependency:tree, 您會看到現(xiàn)在有許多額外的依賴項, 包括Tomcat Web服務器和SpringBoot本身。

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號