如何让Maven编译器插件打印出什么符号导致“无法找到符号”编译失败?

时间:2016-03-18 13:48:54

标签: java maven compiler-errors maven-compiler-plugin

我正在使用Maven 3.3和以下编译器配置......

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <compilerArgument>-proc:none</compilerArgument>
                <fork>true</fork>
            </configuration>
            <executions>
                <execution>
                    <id>default-testCompile</id>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

当我运行“mvn clean install”时,我收到以下编译器错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project core: Compilation failure
[ERROR] /Users/davea/Documents/my_workspace/myproject/src/test/java/org/mainco/subco/mainpkg/subunit/MyTest.java:[248,15] error: cannot find symbol
[ERROR] -> [Help 1]

我的问题是,有没有办法配置东西,以便系统告诉我它找不到什么符号?有时这样做但有时不这样做。下面是该行,但我的问题更多地涉及打印更具体的错误消息,而不是编译下面的行。

        Assert.asertNotNull("A pre-condition of this test is that an object exist witih id \"" + id + "\".", obj);

0 个答案:

没有答案