IDEA 使用maven将第三方jar打包进程序

1.添中第三方包

在程序 pom.xml 加入第三方包,指定包含路径

<dependencies>
    <!--PLC通讯-->
    <dependency>
        <groupId>jamod</groupId>
        <artifactId>jamod</artifactId>
        <version>1.2</version>
        <scope>system</scope>
        <systemPath>${basedir}/src/lib/jamod-1.2-SNAPSHOT.jar</systemPath>
    </dependency>
</dependencies>

scope设成 system,  添加 systemPath 设置第三方包的路径

 

2.修改maven插件配置

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <executable>true</executable>
                <includeSystemScope>true</includeSystemScope>
            </configuration>
        </plugin>
    </plugins>
    <finalName>Timo-${project.version}</finalName>
</build>

记得在maven插件下面加入 configuration 设置,表示打包时需查找system目录程序进行打包.

 

3.备注

到于在 Project Structure 里面添加模块,我这边没有进行设置也能正常打包并运行.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值