社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
目录
一、执行mvn site 出现:错误: 未知标记: name
二、执行mvn site 出现如下:Unable to determine if resource...
[ERROR] E:workspace-marsSSMsrcmainjavacomstarfallssmserviceUrlLogService.java:14: 错误: 未知标记: name
[ERROR] * @name: UrlLogService
初步判断是Maven无法识别JavaDoc中的标记:
解决方案:
加上下方的红色配置:[ERROR]就会变成了[WARNING],最终会build通过的。
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
</plugins>
</reporting>
参考:https://blog.csdn.net/u010071621/article/details/81436340
[ERROR] Unable to determine if resource antlr:antlr:jar:2.7.2:compile exists in http://download.java.net/maven/2/
[ERROR] Unable to determine if resource antlr:antlr:jar:2.7.2:compile exists in http://download.java.net/maven/glassfish
[ERROR] Unable to determine if resource com.alibaba:fastjson:jar:1.2.46:compile exists in http://download.java.net/maven/2/
解决方案:
pom文件增加配置
<properties>
<dependency.locations.enabled>false</dependency.locations.enabled>
</properties>
解决方案:
配置一个系统环境变量
变量名:JAVA_TOOL_OPTIONS
变量值:-Dfile.encoding=UTF-8
参考:https://blog.csdn.net/crazymakercircle/article/details/80259251
参考:https://blog.csdn.net/kp783491236/article/details/82929063
问题重现:
初步判断:
安装的中文系统默认字符集是GBK,我们安装的软件一般都继承使用操作系统的默认字符集。
由于代码使用的UTF-8,而maven编译的时候使用的GBK的缘故。
解决方案:
第一种方法:是在maven插件maven-compiler-plugin下配置encoding:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<!-- 指明编译源代码时使用的字符编码,maven编译的时候默认使用的GBK编码,
通过encoding属性设置字符编码,告诉maven这个项目使用UTF-8来编译 -->
<encoding>utf8</encoding>
</configuration>
</plugin>
第二种方法:在项目的pom.xml文件中添加下面的配置:
<properties>
<!--通过project.build.sourceEncoding属性设置字符编码,告诉maven这个项目使用UTF-8来编译-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
转:https://blog.csdn.net/weixin_42266508/article/details/81436879
删除maven本地库之后重新下载本地库
转:https://blog.csdn.net/qq_38717260/article/details/79417604
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!