简体   繁体   中英

groovy-eclipse-compiler does not show compiler error

when I do a maven clean install, the compilation fails and maven reports a compilation error occurred. It does not however show the class where this happened when using groovy-eclipse-compiler. The plugin config is as below:

<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>

And the output from maven is as below:

[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>确实显示了带有编译器错误的类以及许多其他编译器警告,例如未检查的转换等,但是应该显示错误而不用放这个。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM