【问题标题】:How to configure Checkstyle setup with Oomph如何使用 Oomph 配置 Checkstyle 设置
【发布时间】:2019-08-30 19:23:07
【问题描述】:

我正在使用 Oomph 自动化我们的 IDE 设置。我目前正忙于 Checkstyle。使用记录器功能,当我设置我们公司自己的 Checkstyle 配置时,不会保存任何设置。我该如何解决?

【问题讨论】:

    标签: eclipse checkstyle oomph


    【解决方案1】:

    https://www.eclipse.org/forums/index.php/t/803782/:

    将Resource Creation 任务添加到您的设置文件中,因为 Checkstyle 将其首选项保存在专用文件中,而不是保存在 Oomph 设置中。

    E. g.:

    <setupTask
          xsi:type="setup:CompoundTask"
          id="checkstyle.prefs"
          disabled="false"
          name="Checkstyle Setup">
        <setupTask
            xsi:type="setup:ResourceCreationTask"
            excludedTriggers="BOOTSTRAP"
            filter=""
            content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xA;&#xA;&lt;checkstyle-configurations file-format-version=&quot;5.0.0&quot; default-check-configuration=&quot;GOOS Checkstyle&quot;>&#xA;  &lt;check-configuration name=&quot;GOOS Checkstyle&quot; location=&quot;configuration\checkstyle\goos-checkstyle.xml&quot; type=&quot;external&quot; description=&quot;&quot;>&#xA;    &lt;additional-data name=&quot;protect-config-file&quot; value=&quot;true&quot;/>&#xA;  &lt;/check-configuration>&#xA;&lt;/checkstyle-configurations>&#xA;"
            targetURL="${workspace.location|uri}/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml"
            encoding="UTF-8">
          <description></description>
        </setupTask>
      </setupTask>
    

    targetURL 指定 Checkstyle 首选项的标准保存位置。这也是您可以查找自己的 Checkstyle 配置的地方,因此您可以将其添加到 Oomph Resource Creation 任务的 content。

    【讨论】:

      猜你喜欢
      • 2015-07-01
      • 2016-08-29
      • 2013-09-07
      • 2017-10-31
      • 2012-01-03
      • 2013-11-10
      • 1970-01-01
      • 2017-04-24
      • 2012-09-12
      相关资源
      最近更新 更多