maven项目引入外部jar包 服务器上跑不起来

<dependencies> 
   <dependency>
        <groupId>xxx</groupId>
        <artifactId>xxx</artifactId>
        <version>1.0.0</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/src/main/resources/lib/xxx.jar</systemPath>
    </dependency>
</dependencies>

 当项目中引用外部jar包时,需要增加<includeSystemScope>true</includeSystemScope>,代表maven打包时会将外部引入的jar包

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

猜你喜欢

转载自blog.csdn.net/qq_37928038/article/details/123479068