0

我试图通过 Maven 存储库添加检查器框架我遵循检查器框架手动步骤但我在 intelij ide 上收到此错误

无法解析符号

其他人提到在Google 群组上遇到同样的问题,请提供任何帮助

我的maven包是这样的

  <properties>
    <annotatedJdk>${org.checkerframework:jdk8:jar}</annotatedJdk>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
        <groupId>org.checkerframework</groupId>
        <artifactId>checker-qual</artifactId>
        <version>2.5.1</version>
    </dependency>
    <dependency>
        <groupId>org.checkerframework</groupId>
        <artifactId>jdk8</artifactId>
        <version>2.5.1</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.6.1</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <compilerArguments>
              <Xmaxerrs>10000</Xmaxerrs>
              <Xmaxwarns>10000</Xmaxwarns>
            </compilerArguments>
            <annotationProcessorPaths>
              <path>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker</artifactId>
                <version>2.5.1</version>
              </path>
            </annotationProcessorPaths>
            <annotationProcessors><annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
            </annotationProcessors>
            <compilerArgs>
              <arg>-AprintErrorStack</arg>
              <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <goals>
                <goal>properties</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.7.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.20.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                  <source>8</source>
                  <target>8</target>
              </configuration>
          </plugin>
      </plugins>
  </build>

告诉我是否错过任何步骤,它也不允许删除错误的那一行

4

2 回答 2

0

我能够避免这个问题的方法是声明属性如下:

<checkerframework.version>2.5.6</checkerframework.version>
<annotatedJdk>${settings.localRepository}/org/checkerframework/jdk8/${checkerframework.version}/jdk8-${checkerframework.version}.jar</annotatedJdk>

然后重新导入 Maven 项目。

另请注意,使用它可能不需要配置maven-dependency-plugin任何一个。

于 2018-11-05T07:18:27.730 回答
0

假设项目是由 Maven 从命令行正确构建的,这看起来像 IntelliJ IDEA 突出显示问题:IDEA-129269 / IDEA-187553

于 2018-05-16T10:59:24.290 回答