java项目中的第三方依赖引入程序和打进jar包

Java项目中经常会遇到有些依赖无法直接下载进maven仓库

解决方法:

在模块中创建lib包,然后自己去手动下相关依赖并复制到lib文件夹下

然后在pom文件中添加,下面的版本引用在父类已经定义了 若没定义可以自己写死

        <dependency>
            <groupId>com.yashandb</groupId>
            <artifactId>yashandb-jdbc</artifactId>
            <version>${yashandb-jdbc.version}</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/yashandb-jdbc-1.7.9.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>YashanDialect-for-hibernate5</artifactId>
            <version>${yashanDialect.version}</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/YashanDialect-for-hibernate5-1.0.0.jar</systemPath>
        </dependency>

并且若要打包能将此依赖打进jar包需要添加

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值