1

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

4

1 回答 1

0

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

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

例如:

<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 配置的地方,因此您可以将其添加到contentOomphResource Creation任务中。

于 2019-04-09T13:15:52.977 回答