maven項目對於maven遠程倉庫沒有資源的解決辦法


下載資源到本地

方法一:dependency scope 是system 類型

復制代碼
 <dependency>
            <groupId>edu.ucar</groupId>
            <artifactId>netcdfAll</artifactId>
            <version>4.6.6</version>
            <scope>system</scope>
            <systemPath>D:/workspace/gitlab/dezhou-task-addins-cimiss/20181205/lib/netcdfAll-4.6.6.jar</systemPath>
        </dependency>
復制代碼

 這里有一點順便做個紀錄,有的時候Maven打包不能把以上配置的jar包打到項目中的時候,可以嘗試如下方案嘗試解決:

在pom中給spring boot的打包插件設置一下includeSystemScope參數即可

復制代碼
<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <includeSystemScope>true</includeSystemScope>
      </configuration>
    </plugin>
  </plugins>
</build>
復制代碼

 

 

方法二:mvn install:install-file -Dfile=D:\迅雷下載\netcdfAll-4.6.6.jar -DgroupId=edu.ucar -DartifactId=netcdfAll -Dversion=4.6.6 -Dpackaging=jar 把一個本地jar 安裝到本地倉庫中


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM