maven安装jar到本地
作者:互联网
1. 先执行 mvn -v 查看maven环境配置是否正确
2.添加jar到本地,注意相关参数加英文引号,否则可能报错The goal you specified requires a project to execute but there is no POM in this directory。。。
mvn install:install-file "-Dfile=jar包所在位置" "-DgroupId=在pom中的groupId" "-DartifactId=在pom中的artifactId" "-Dversion=在pom中的version" "-Dpackaging=jar"
// 示例
mvn install:install-file "-Dfile=D:\softWare\Jaspersoft Studio-6.8.0\jasperreports-fonts-6.8.0.jar" "-DgroupId=com.zzg.report" "-DartifactId=font" "-Dversion=1.0.0" "-Dpackaging=jar"
3.在pom中依赖:
<!--字体文件依赖-->
<dependency>
<groupId>com.zzg.report</groupId>
<artifactId>font</artifactId>
<version>1.0.0</version>
</dependency>
标签:DartifactId,1.0,本地,jar,maven,pom,install,mvn 来源: https://blog.csdn.net/y_onghuming/article/details/104896021