Intellij:无法识别 skipTests 标志

Intellij: skipTests flag not recognized

我在 pom.xml 中获得了以下 Maven 配置 Intellij Ultimate 2018.1 将 skipTests 变量突出显示为红色

Cannot resolve symbol 'skipTests'

但是为什么呢?这是一个普通的maven环境变量。

<build>
 <plugins>
  <plugin>
    <!-- exec yarn -->
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
      ...
      <execution>
        <id>yarn-test</id>
        <phase>process-test-classes</phase>
        <goals>
          <goal>exec</goal>
        </goals>
        <configuration>
          <executable>yarn</executable>
          <skip>${skipTests}</skip>
          <arguments>
            <argument>test</argument>
          </arguments>
        </configuration>
      </execution>
    </executions>
  </plugin>
 </plugins>
</build>

尝试重启Intellij Idea,有时错误只有重启才会消失。如果这不起作用,请尝试更改 Maven 的版本。

编辑

检查此 link,我认为这会对您有所帮助

我通过设置 intellij 忽略评论解决了这个问题

<!--suppress MavenModelInspection -->

在那条特定的 pom 行上。