本地jar包导入本地仓库步骤:
1、maven环境配置
1.1 设置maven_home 如图所示
1.2 path路径添加 如图所示
2、打开cmd命令行输入:
mvn install:install-file -DgroupId=com.jspsmart -DartifactId=upload -Dversion=1.0 -Dpackaging=jar -Dfile=D:\maven\apache-maven-repository\smartupload.jar
DgroupId---->com.jspsmart
DartifactId----->upload
Dpackaging----->jar
Dfile------->本地jar包的绝对地址
出现build success即为成功。
重构项目idea。
打包jar包出现Process terminated问题,原因:pom文件jar包原是本地地址,现要将jar包部署到linux服务器上,路径打包出现问题,解决办法
<dependency>
<groupId>com.jacob</groupId>
<artifactId>activeX</artifactId>
<version>1.18</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/jacob.jar</systemPath>
</dependency>
<plugins>
<!-- 打jar包 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
<!--如果没有该配置,无法将本地lib下的jar包打包进生成的jar包中-->
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
重新打包即可。