轉載地址: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文件的任意節點的內容

