Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse maven安装失败";“不支持泛型”;_Eclipse_Maven - Fatal编程技术网

Eclipse maven安装失败";“不支持泛型”;

Eclipse maven安装失败";“不支持泛型”;,eclipse,maven,Eclipse,Maven,我使用嵌入式jetty服务器构建war,我通过eclipse运行maven clean,然后安装maven。我得到了一堆“不支持”的错误 \RoleDao.java:[86,13]在-source 1.3中不支持泛型 (使用-source 5或更高版本以启用泛型) 公共列表findAllRoles() -source 1.3中不支持UserAuth.java:[44,1]注释 (使用-source 5或更高版本来启用注释) @抑制警告(“弃用”) 有人有主意吗?谢谢错误消息指出您正在定义语言级

我使用嵌入式jetty服务器构建war,我通过eclipse运行maven clean,然后安装maven。我得到了一堆“不支持”的错误

\RoleDao.java:[86,13]在-source 1.3中不支持泛型
(使用-source 5或更高版本以启用泛型)
公共列表findAllRoles()
-source 1.3中不支持UserAuth.java:[44,1]注释
(使用-source 5或更高版本来启用注释)
@抑制警告(“弃用”)

有人有主意吗?谢谢

错误消息指出您正在定义语言级别1.3。这是旧版本Maven编译器插件(如2.0)的默认设置。升级到更新的版本,如2.3.2,甚至是最新的2.5.1,默认值为1.5,应该可以正常工作


同时,您还可以升级到最新版本的Maven(3.0.4),以使这些较新版本的Maven编译器插件成为默认版本。

正如Manfred指出的,这是默认版本的问题。为了消除这个严重错误,您可以在pom.xml中升级maven版本、maven编译器插件版本或配置版本

<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <source>1.5</source>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

org.apache.maven.plugins

搜索-sourcerelease

我在使用Maven 3.0.4时遇到了类似的问题,它似乎选择了-source 1.3作为默认版本。为了解决这个问题,我必须按照下面Tomasz的回答指定编译器插件源代码。
<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <source>1.5</source>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>