【问题标题】:What does "Supported source version 'RELEASE_5' from annotation processor..." mean?“注释处理器支持的源版本'RELEASE_5'......”是什么意思?
【发布时间】:2012-05-31 02:28:34
【问题描述】:

这是什么意思以及如何删除它(重新格式化以提高可读性)?

[INFO] Compiling 30 source files to ...\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
warning: Supported source version 'RELEASE_5' from annotation processor 
'org.sonatype.guice.bean.scanners.index.QualifiedIndexAPT6' 
less than -source '1.6'
warning: No processor claimed any of these annotations: 
org.junit.Ignore,org.junit.Test,org.junit.BeforeClass

org.sonatype.sisu:sisu-inject-plexus:2.1.1 是项目依赖项之一时会发生这种情况。

【问题讨论】:

    标签: java maven annotations sonatype plexus


    【解决方案1】:

    sisu-inject-plexus 升级到以下版本后删除了第一个警告:

    <dependency>
      <groupId>org.sonatype.sisu</groupId>
      <artifactId>sisu-inject-plexus</artifactId>
      <version>2.3.0</version>
    </dependency>
    

    使用javac编译器的-Xlint:-processing标志后的第二个:

    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <executions>
        <execution>
          <id>default-testCompile</id>
          <configuration>
            <compilerArgument>-Xlint:-processing</compilerArgument>
          </configuration>
        </execution>
      <execution>
    </plugin>
    

    否则,我们可以使用

    <compilerArgument>-proc:none</compilerArgument>
    

    【讨论】:

      【解决方案2】:

      这里有两个不相关的警告。首先,有一个类声称它想查看注解,但它只理解 Java 5 语法,并且您已经在命令行中指定了 Java 6 语法;其次,您在其中有一些 JUnit 注释,但没有看到它们。

      它们听起来都可以忽略不计,但不幸的是,这里尝试运行 javac 的任何东西(是 apt 吗?)都无法理解输出。

      【讨论】:

      • 欧内斯特,你能解释一下“没有人在看他们”是什么意思吗?
      • 这个输出来自apt,我想,注解处理工具,其目的是找到代码中的所有注解,并使它们可用于插件“注解处理器” .该工具只是警告您存在一些未注册注释处理器的注释。这根本不是一件坏事——如果你现在没有运行 JUnit,那么就不需要关心那些 JUnit 注释。
      • 知道了,但这条消息是由javac 发送的(由 Apache Maven 3.0.3 maven-compiler-plugin 2.4 运行)。你知道该怎么做才能消除警告。忽略它不是我的选择。
      猜你喜欢
      • 2014-05-27
      • 1970-01-01
      • 2014-05-02
      • 2017-03-18
      • 1970-01-01
      • 1970-01-01
      • 2014-03-08
      • 2018-01-02
      • 1970-01-01
      相关资源
      最近更新 更多