maven打本地

1,pom引入本地jar,systemPath路径必须写对。 {project.basedir}和{pom.basedir}都可以正确引用

XML 复制代码
<dependency>
    <groupId>esigntech-tgtext</groupId>
    <artifactId>esigntech-tgtext</artifactId>
    <version>3.3.64.2160</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/libs/tgtext-3.3.64.2160.jar</systemPath>
</dependency>

2,pom文件加上includeSystemScope配置

XML 复制代码
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <includeSystemScope>true</includeSystemScope>
            </configuration>
        </plugin>
    </plugins>
</build>

3,其实上面两步已经就可以打包本地jar了。但是要注意打包后的jar文件名不是上面引入的tgtext-3.3.64.2160.jar了,而是{artifactId}-{version}.jar。上面的例子中也就是esigntech-tgtext-3.3.64.2160.jar

不要因为没有找到原始jar文件就认为本地包没打包进lib了....

相关推荐
张柏慈4 小时前
Java性能优化:实战技巧与案例解析
java
天“码”行空4 小时前
简化Lambda——方法引用
java·开发语言
带刺的坐椅5 小时前
MCP 进化:让静态 Tool 进化为具备“上下文感知”的远程 Skills
java·ai·llm·agent·solon·mcp·tool-call·skills
java1234_小锋5 小时前
Java线程之间是如何通信的?
java·开发语言
张张努力变强5 小时前
C++ Date日期类的设计与实现全解析
java·开发语言·c++·算法
while(1){yan}6 小时前
Spring事务
java·数据库·spring boot·后端·java-ee·mybatis
毕设源码-赖学姐6 小时前
【开题答辩全过程】以 高校社团管理平台为例,包含答辩的问题和答案
java
余瑜鱼鱼鱼6 小时前
线程和进程的区别和联系
java·开发语言·jvm
小唐同学爱学习6 小时前
如何解决海量数据存储
java·数据库·spring boot·mysql
962464i7 小时前
SBE(simple-binary-encoding)-Demo
java