0

我正在尝试使用 mave-compiler-plugin 添加调试符号(这样我就可以访问方法参数名称)。按照可在此处找到的可用配置,这是我的 maven-compiler-plugin 配置

                        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <compilerArgument>-Xlint:all</compilerArgument>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
                <debug>true</debug>
                <debugLevel>lines,vars,source</debugLevel>
            </configuration>
        </plugin>

直到现在,我还没有成功。

有人可以让我知道如何使用 maven 添加调试符号吗?

4

1 回答 1

0

您可能需要<fork>true</fork>根据maven-compiler-plugin 文档compilerArgument添加.

如果 fork 设置为 true,则设置要传递给编译器的未格式化的单个参数字符串。

不确定是否需要,但您可能需要添加<groupId>org.apache.maven.plugins</groupId><version>#.#.#<\version>.

此外,正如评论中提到的@JonK,您需要source而不是sourcesfor debugLevel

于 2014-05-21T13:09:00.763 回答