[英]Maven throwing error during “mvn site” but works fine with “mvn compile”/“mvn test”
Today i was trying to generate the report using the site command through Maven and encountered a problem during the compilation phase. 今天,我试图通过Maven使用site命令生成报告,并且在编译阶段遇到了问题。
ParseException in /Users/rajesh/Documents/workspace/mobileads/mobileads-core/src/main/java/com/nimbuzz/mobileads/util/AdRequestAnalyticsLogger.java
Last useful checkpoint: "com.nimbuzz.mobileads.util.AdRequestAnalyticsLogger.logAdOk(AdRequest,String)"
Encountered " ">" "> "" at line 32, column 55.
Was expecting one of:
"boolean" ...
"byte" ...
"char" ...
"double" ...
"float" ...
"int" ...
"long" ...
"short" ...
<IDENTIFIER> ...
"?" ...
"boolean" ...
"char" ...
"byte" ...
"short" ...
"int" ...
"long" ...
"float" ...
"double" ...
<IDENTIFIER> ...
"?" ...
"?" ...
"?" ...
"?" ...
To my surprise when i run the compile or test command the same files compile properly. 令我惊讶的是,当我运行compile或test命令时,相同的文件可以正确编译。
Now I have two doubts here 现在我有两个疑问
1). 1)。 When i go to AdRequestAnalyticsLogger.java where it is giving me this problem i could see the code as 当我转到AdRequestAnalyticsLogger.java时,它给了我这个问题,我可以将代码视为
final List<String> toBeLogged = new ArrayList<>(ad.asList());
mind it there is not String in tilts after ArrayList. 请注意,在ArrayList之后没有倾斜的String。
Now the doubt is,Does java accept the "ArrayList<>" rather then "ArrayList".If it is suppose to be "ArrayList" then how come it is compiling but not working when doing "mvn site". 现在的疑问是,java是否接受“ ArrayList <>”而不是“ ArrayList”。如果假设是“ ArrayList”,那么它如何编译却在执行“ mvn site”时不起作用。
2). 2)。 What are the difference between "mvn compile"/"mvn test"/"mvn site" “ mvn编译” /“ mvn测试” /“ mvn网站”之间有什么区别
Regards, Rajesh 问候,拉杰什
You have a plugin in your site lifecycle that doesn't know how to parse the Java 7 diamond operator you're using. 您的网站生命周期中有一个不知道如何解析所用Java 7 Diamond运算符的插件。
Take a look at the log before that error to see which plugin it is. 查看该错误之前的日志,以了解它是哪个插件。 You'll either need to configure it to expect Java 7 or upgrade. 您将需要对其进行配置以使用Java 7或进行升级。
Possibly related to JAVANCSS-9 : 可能与JAVANCSS-9有关 :
I get the following parse error, when using the cobertura-maven-plugin (2.5.1) with the javancss-maven-plugin (2.0): ... The code piece uses Java 1.7 将cobertura-maven-plugin(2.5.1)与javancss-maven-plugin(2.0)结合使用时,出现以下解析错误:...该代码段使用Java 1.7
now fixed in the latest version. 现在已在最新版本中修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.