Maven打包缺少system依赖

kyaa111 2月前 ⋅ 383 阅读
<dependency>
    <groupId>com.alibaba.xxx</groupId>
    <artifactId>xxx.xxx.java.basic</artifactId>
    <scope>system</scope>
    <version>x.x.x</version>
    <systemPath>${project.basedir}/src/main/resources/lib/xxx.jar</systemPath>
</dependency>

测试环境一直java.lang.ClassNotFoundException

方案一

上传到maven私仓

方案二

打包到本地maven 库

mvn install:install-file -Dfile=D:\system\xxx.jar -DgroupId=com.alibaba.xxx -DartifactId=xxx.java -Dversion=x.x.x -Dpackaging=jar

方案三

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <includeSystemScope>true</includeSystemScope>
    </configuration>
</plugin>