【问题标题】:Add the debug symboles by using maven使用 maven 添加调试符号
【发布时间】:2014-07-10 02:48:48
【问题描述】:

我正在尝试使用mave-compiler-plugin 添加调试符号(这样我就可以访问方法参数名称)。 按照here 可以找到的可用配置, 这是我的 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 添加调试符号吗?

【问题讨论】:

  • debugLevel 的合法值为 nonelinesvarssource(即 not sources )。
  • THX,我用来源(而不是来源......)更新了问题。仍然没有进展。

标签: java maven maven-compiler-plugin


【解决方案1】:

您可能需要根据maven-compiler-plugin documentationcompilerArgument添加&lt;fork&gt;true&lt;/fork&gt;

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

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

另外,正如 @JonK 在 cmets 中提到的,你需要 source 而不是 sources 来代替 debugLevel

【讨论】:

  • 不幸的是,添加 true 并没有解决问题。
猜你喜欢
  • 2020-12-02
  • 1970-01-01
  • 1970-01-01
  • 2019-09-14
  • 1970-01-01
  • 1970-01-01
  • 2012-04-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多