IDEA maven mvn install無法引用手動導入的jar包的解決方式


 

轉載地址:maven system path,加載本地jar

 

當引用第三方包,且沒有源代碼時候,可以使用system path

復制代碼
<dependency>
    <groupId>ctec</groupId>
    <artifactId>xxx-core</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/libs/ctec-xxx-core.jar</systemPath>
</dependency>
復制代碼

僅這樣做,並不能將jar包含到war中,需要使用<includeSystemScope>true</includeSystemScope>

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

常見內置變量

${basedir} 項目根目錄
${project.build.directory} 構建目錄,缺省為target
${project.build.outputDirectory} 構建過程輸出目錄,缺省為target/classes
${project.build.finalName} 產出物名稱,缺省為${project.artifactId}-${project.version}
${project.packaging} 打包類型,缺省為jar
${project.xxx} 當前pom文件的任意節點的內容

 


免責聲明!

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



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