欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解析spring-boot-starter-parent簡(jiǎn)介

 更新時(shí)間:2018年09月19日 15:03:20   投稿:mrr  
本文通過代碼的形式給大家介紹了spring-boot-starter-parent的基礎(chǔ)知識(shí),需要的朋友可以參考下

本指南將幫助您了解Spring Boot Starter Parent如何幫助管理依賴項(xiàng)版本,所有Spring Boot項(xiàng)目通常使用spring-boot-starter-parent作為pom.xml中的父項(xiàng):

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.0.RELEASE</version>
  </parent>

Parent Poms為多個(gè)子項(xiàng)目和模塊管理以下內(nèi)容:

  • 配置 - Java版本和其他屬性
  • Depedency Management - 依賴項(xiàng)的版本
  • 默認(rèn)插件配置

內(nèi)部原理

首先 啟動(dòng)器Spring Boot Starter Parent將spring-boot-dependencies定義為父pom。它從spring-boot-dependencies繼承了依賴關(guān)系管理。

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-dependencies</artifactId>
  <version>1.4.0.RELEASE</version>
  <relativePath>../../spring-boot-dependencies</relativePath>
</parent>

默認(rèn)的java版本是1.6。項(xiàng)目可以通過<java.version>1.8</java.version>在項(xiàng)目pom中指定屬性來覆蓋它。還有一些與編碼和源相關(guān)的其他設(shè)置,目標(biāo)版本也在父pom中設(shè)置。

<java.version>1.6</java.version>
<resource.delimiter>@</resource.delimiter> <!-- delimiter that doesn't clash with Spring ${} placeholders -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

Spring Boot Starter Parent指定了一系列插件的默認(rèn)配置,包括maven-failsafe-plugin,maven-jar-plugin和maven-surefire-plugin。

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <executions>
   <execution>
     <goals>
      <goal>integration-test</goal>
      <goal>verify</goal>
     </goals>
   </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
   <archive>
     <manifest>
      <mainClass>${start-class}</mainClass>
      <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
     </manifest>
   </archive>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
   <includes>
     <include>**/*Tests.java</include>
     <include>**/*Test.java</include>
   </includes>
   <excludes>
     <exclude>**/Abstract*.java</exclude>
   </excludes>
  </configuration>
</plugin>

Spring Boot Starter Parent從spring-boot-dependencies繼承了什么?

Spring Boot Dependencies定義了所有Spring Boot項(xiàng)目的默認(rèn)依賴關(guān)系管理。如果我們想要使用特定依賴項(xiàng)的新版本,我們可以通過在項(xiàng)目pom中指定新屬性來覆蓋該版本。下面的摘錄顯示了由Spring Boot Dependencies父pom管理的一些重要依賴項(xiàng)。由于Spring Boot Starter Parent繼承自spring-boot-dependencies,因此它也共享所有這些特性。

<properties>
  <activemq.version>5.13.4</activemq.version>
     ...
  <ehcache.version>2.10.2.2.21</ehcache.version>
  <ehcache3.version>3.1.1</ehcache3.version>
     ...
  <h2.version>1.4.192</h2.version>
  <hamcrest.version>1.3</hamcrest.version>
  <hazelcast.version>3.6.4</hazelcast.version>
  <hibernate.version>5.0.9.Final</hibernate.version>
  <hibernate-validator.version>5.2.4.Final</hibernate-validator.version>
  <hikaricp.version>2.4.7</hikaricp.version>
  <hikaricp-java6.version>2.3.13</hikaricp-java6.version>
  <hornetq.version>2.4.7.Final</hornetq.version>
  <hsqldb.version>2.3.3</hsqldb.version>
  <htmlunit.version>2.21</htmlunit.version>
  <httpasyncclient.version>4.1.2</httpasyncclient.version>
  <httpclient.version>4.5.2</httpclient.version>
  <httpcore.version>4.4.5</httpcore.version>
  <infinispan.version>8.2.2.Final</infinispan.version>
  <jackson.version>2.8.1</jackson.version>
     ....
  <jersey.version>2.23.1</jersey.version>
  <jest.version>2.0.3</jest.version>
  <jetty.version>9.3.11.v20160721</jetty.version>
  <jetty-jsp.version>2.2.0.v201112011158</jetty-jsp.version>
  <spring-security.version>4.1.1.RELEASE</spring-security.version>
  <tomcat.version>8.5.4</tomcat.version>
  <undertow.version>1.3.23.Final</undertow.version>
  <velocity.version>1.7</velocity.version>
  <velocity-tools.version>2.0</velocity-tools.version>
  <webjars-hal-browser.version>9f96c74</webjars-hal-browser.version>
  <webjars-locator.version>0.32</webjars-locator.version>
  <wsdl4j.version>1.6.3</wsdl4j.version>
  <xml-apis.version>1.4.01</xml-apis.version>
</properties>

將Maven 3.2.1定義為所需的最低版本:

<prerequisites>
  <maven>3.2.1</maven>
</prerequisites>

Spring Boot

總結(jié)

以上所述是小編給大家介紹的spring-boot-starter-parent簡(jiǎn)介,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • java實(shí)現(xiàn)簡(jiǎn)單斗地主(看牌排序)

    java實(shí)現(xiàn)簡(jiǎn)單斗地主(看牌排序)

    這篇文章主要介紹了java實(shí)現(xiàn)簡(jiǎn)單斗地主,看牌進(jìn)行排序,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2010-11-11
  • Java基礎(chǔ)之Spring5的核心之一IOC容器

    Java基礎(chǔ)之Spring5的核心之一IOC容器

    這篇文章主要介紹了Java基礎(chǔ)之Spring5的核心之一IOC容器,文中有非常詳細(xì)的代碼示例,對(duì)正在學(xué)習(xí)java的小伙伴們有非常好的幫助,需要的朋友可以參考下
    2021-04-04
  • spring中BeanUtils.copyProperties的使用(深拷貝,淺拷貝)

    spring中BeanUtils.copyProperties的使用(深拷貝,淺拷貝)

    本文主要介紹了spring中BeanUtils.copyProperties的使用(深拷貝,淺拷貝),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-05-05
  • Java實(shí)現(xiàn)二分查找BinarySearch算法

    Java實(shí)現(xiàn)二分查找BinarySearch算法

    這篇文章主要介紹了Java實(shí)現(xiàn)二分查找BinarySearch算法,二分查找針對(duì)的是一個(gè)有序的數(shù)據(jù)集合,每次都通過跟區(qū)間的中間元素對(duì)比,將待查找的區(qū)間縮小為之前的一半,直到找到要查找的元素,或者區(qū)間被縮小為 0,需要的朋友可以參考下
    2023-12-12
  • 使用MyBatis查詢千萬級(jí)數(shù)據(jù)量操作實(shí)現(xiàn)

    使用MyBatis查詢千萬級(jí)數(shù)據(jù)量操作實(shí)現(xiàn)

    這篇文章主要為大家介紹了如何使用MyBatis?查詢千萬數(shù)據(jù)量的操作過程詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-05-05
  • Java8如何使用Lambda表達(dá)式簡(jiǎn)化代碼詳解

    Java8如何使用Lambda表達(dá)式簡(jiǎn)化代碼詳解

    這篇文章主要給大家介紹了關(guān)于Java8如何使用Lambda表達(dá)式簡(jiǎn)化的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-11-11
  • springboot實(shí)現(xiàn)敏感字段加密存儲(chǔ)解密顯示功能

    springboot實(shí)現(xiàn)敏感字段加密存儲(chǔ)解密顯示功能

    這篇文章主要介紹了springboot實(shí)現(xiàn)敏感字段加密存儲(chǔ),解密顯示,通過mybatis,自定義注解+AOP切面,Base64加解密方式實(shí)現(xiàn)功能,本文通過代碼實(shí)現(xiàn)給大家介紹的非常詳細(xì),需要的朋友可以參考下
    2022-02-02
  • 散列表的原理與Java實(shí)現(xiàn)方法詳解

    散列表的原理與Java實(shí)現(xiàn)方法詳解

    這篇文章主要介紹了散列表的原理與Java實(shí)現(xiàn)方法,詳細(xì)分析了散列表的原理,并結(jié)合實(shí)例形式分析了java實(shí)現(xiàn)散列表相關(guān)操作技巧,需要的朋友可以參考下
    2019-09-09
  • spring-boot-maven-plugin報(bào)紅解決方案(親測(cè)有效)

    spring-boot-maven-plugin報(bào)紅解決方案(親測(cè)有效)

    本文主要介紹了spring-boot-maven-plugin報(bào)紅解決方案,文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-03-03
  • Java中的@Repeatable注解使用詳解

    Java中的@Repeatable注解使用詳解

    這篇文章主要介紹了Java中的@Repeatable注解使用詳解,@Repeatable注解是java8為了解決同一個(gè)注解不能重復(fù)在同一類/方法/屬性上使用的問題,本文提供了解決思路和部分實(shí)現(xiàn)代碼,需要的朋友可以參考下
    2024-02-02

最新評(píng)論