在使用Maven管理依赖时,有时第三方Jar包必须得下载下来本地使用,这里总结maven配置本地依赖的几种方式。
方式一 安装jar文件包到本地仓库
mvn install:install-file -Dfile=D:\workspace\xf-cloud\lib\taobao-sdk-java-auto_1479188381469-20210727.jar -DgroupId=com.dingtalk -DartifactId=dingtalk-api-sdk -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true
安装过程如下:
C:\Users\Winbert>mvn install:install-file -Dfile=D:\workspace\xf-cloud\lib\taobao-sdk-java-auto_1479188381469-20210727.jar -DgroupId=com.dingtalk -DartifactId=dingtalk-api-sdk -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing D:\workspace\xf-cloud\lib\taobao-sdk-java-auto_1479188381469-20210727.jar to D:\ProgramData\maven-repository\com\dingtalk\dingtalk-api-sdk\1.0.0-SNAPSHOT\dingtalk-api-sdk-1.0.0-SNAPSHOT.jar
[INFO] Installing C:\Users\Winbert\AppData\Local\Temp\mvninstall6463484044721168508.pom to D:\ProgramData\maven-repository\com\dingtalk\dingtalk-api-sdk\1.0.0-SNAPSHOT\dingtalk-api-sdk-1.0.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.512 s
[INFO] Finished at: 2021-08-09T00:12:30+08:00
[INFO] ------------------------------------------------------------------------
方式二 配置pom文件
<dependency>
<groupId>com.dingtalk</groupId>
<artifactId>dingtalk-api-sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/taobao-sdk-java-auto_1479188381469-20210727.jar</systemPath>
</dependency>
配置插件,打包时将本地jar文件打入:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
Reference
最新评论
网飞没问题, 迪士尼+有解决方案么?
pp助手是安卓手机用的,根本下载用不来苹果
已解决
这样的话数据库里的结构为{"attachment":{"content":"xxx"}}, 要怎么才能变成{"content":"xxx"},从而使结构保持一致?
赞! make test不过的坑都写到的,谢谢楼主~
谢谢你
用了root用户还是一直502是怎么回事呢
student id 是空的