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>