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>
发布了26 篇原创文章 · 获赞 4 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/y_onghuming/article/details/104896021