Maven 將scope=system的依賴打進jar包

如果項目不幸需要依賴不在中央倉庫的jar包,可以通過配置systeam方式引用依賴。

<dependency>
    <groupId>groupId</groupId>
    <artifactId>artifactId</artifactId>
    <version>1.0.0</version>
    <scope>system</scope>
    <systemPath>${pom.basedir}/lib/artifactId.jar</systemPath>
</dependency>

同時需要添加編譯插件,使依賴打進jar包。

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <includeSystemScope>true</includeSystemScope>
        <!-- 是否限制解壓縮 -->
        <executable>false</executable>
      </configuration>
    </plugin>
  </plugins>
</build>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章