欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Maven主模塊和子模塊pom.xml-創(chuàng)新互聯(lián)

Maven 主模塊和子模塊pom.xml?針對這個問題,這篇文章詳細介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

創(chuàng)新互聯(lián)服務(wù)項目包括楚雄州網(wǎng)站建設(shè)、楚雄州網(wǎng)站制作、楚雄州網(wǎng)頁制作以及楚雄州網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,楚雄州網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到楚雄州省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!

背景知識

dependencies與dependencyManagement的區(qū)別

  • 父項目中的 <dependencies></dependencies> 中定義的所有依賴,在子項目中都會直接繼承。
  • 在父項目中的 <dependencyManagement></dependencyManagement> 中定義的所有依賴,子項目并不會繼承,我們還要在子項目中引入我們需要的依賴,才能進行使用。此時我們在子項目中不用設(shè)置版本。

實驗

為了回答這個問題:“如果依賴全部放入父模塊,部分子模塊沒有用到這些依賴,是否會增加這些子模塊打包后的代碼體積?”。我們拿一個 maven 多模塊項目打包測試一下。

實驗材料:

Maven 主模塊和子模塊pom.xml

如圖,一個多模塊項目。

其中 wx-common 模塊只是放了一些 enums:

Maven 主模塊和子模塊pom.xml

父模塊依賴:

<properties>
  <java.version>11</java.version>
  <spring-cloud.version>Hoxton.SR8</spring-cloud.version>
  <wx-common-version>0.0.1-SNAPSHOT</wx-common-version>
</properties>

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

  <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    <version>2.2.5.RELEASE</version>
  </dependency>

  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <version>2.2.6.RELEASE</version>
    <scope>test</scope>
    <exclusions>
      <exclusion>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
      </exclusion>
    </exclusions>
  </dependency>

  <!--lombok-->
  <dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.12</version>
  </dependency>

  <!-- https://mvnrepository.com/artifact/org.json/json -->
  <dependency>
    <groupId>org.json</groupId>
    <artifactId>json</artifactId>
    <version>20190722</version>
  </dependency>

  <dependency>
    <groupId>com.jellyfishmix.interchange</groupId>
    <artifactId>common</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </dependency>

  <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-openfeign</artifactId>
    <version>2.2.2.RELEASE</version>
  </dependency>
</dependencies>

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-dependencies</artifactId>
      <version>${spring-cloud.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
    <dependency>
      <groupId>com.jellyfishmix.interchange</groupId>
      <artifactId>wx-common</artifactId>
      <version>${wx-common-version}</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

網(wǎng)頁名稱:Maven主模塊和子模塊pom.xml-創(chuàng)新互聯(lián)
鏈接地址:http://www.chinadenli.net/article40/dcijho.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航電子商務(wù)網(wǎng)站維護小程序開發(fā)網(wǎng)站導(dǎo)航商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運營