解决maven工程打包未将本地jar包打入问题

  • Post author:
  • Post category:其他


1.在项目根节点下创建lib文件夹,将需要的jar包拖入;

2.pom文件编辑:

<!-- 手动引入的包 -->
<dependency>
    <groupId>**</groupId>
    <artifactId>**</artifactId>
    <version>**</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/**.jar</systemPath>
</dependency>
<!-- 重点!!! -->
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <!-- maven工程打包,可以将手动拖入的包也引用进目标jar包 -->
            <configuration>
                <includeSystemScope>true</includeSystemScope>
            </configuration>
        </plugin>
    </plugins>
</build>

注:本地启动需要将jar包添加至项目的Libraries中。



版权声明:本文为weixin_55626194原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。