[英]groovy-eclipse-compiler does not show compiler error
當我執行maven全新安裝時,編譯失敗,並且maven報告發生了編譯錯誤。 但是,它沒有顯示使用groovy-eclipse-compiler時發生這種情況的類。 插件配置如下:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<!-- 2.8.0-01 and later require maven-compiler-plugin 3.0 or higher -->
<version>3.1</version>
<configuration>
<!-- Using the groovy-eclipse-compiler plugin because the gmaven plugin doesn't support compilation -->
<compilerId>groovy-eclipse-compiler</compilerId>
<!-- set verbose to be true if you want lots of uninteresting messages -->
<verbose>true</verbose>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<encoding>ISO-8859-1</encoding>
</configuration>
<dependencies>
<dependency>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.8.0-01</version>
</dependency>
<!-- for 2.8.0-01 and later you must have an explicit dependency on
groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<!-- <version>1.8.6-01</version> -->
<!-- or choose a different compiler version -->
<version>2.1.5-03</version>
<!-- <version>1.7.10-06</version> -->
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
</dependency>
</dependencies>
</plugin>
和從Maven的輸出如下:
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myproject ---
[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] Classpath:
[INFO] All args: []
[INFO] 17 files left.
[INFO] 16 files left.
[INFO] 15 files left.
[INFO] 14 files left.
[INFO] 13 files left.
[INFO] 12 files left.
[INFO] 11 files left.
[INFO] 10 files left.
[INFO] 9 files left.
[INFO] 8 files left.
[INFO] 7 files left.
[INFO] 6 files left.
[INFO] 5 files left.
[INFO] 4 files left.
[INFO] 3 files left.
[INFO] 2 files left.
[INFO] 1 file left.
[INFO] 0 files left.
[INFO] Compilation complete. Compiled 18 files.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Found 1 error and 0 warnings.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.337 s
[INFO] Finished at: 2015-08-20T17:43:11-07:00
[INFO] Final Memory: 21M/221M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project myproject: Compilation failure
[ERROR] Found 1 error and 0 warnings.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
添加<showWarnings>true</showWarnings>
確實顯示了帶有編譯器錯誤的類以及許多其他編譯器警告,例如未檢查的轉換等,但是應該顯示錯誤而不用放這個。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.