代码之家  ›  专栏  ›  技术社区  ›  Pran

Maven对JRE的使用感到困惑

  •  11
  • Pran  · 技术社区  · 15 年前

    当我想跑的时候 mvn clean install 从终端,它给我以下错误。

    …在-source 1.3中不支持泛型(使用-source 5或更高版本来启用泛型)。。。

    我怎样才能:

    • 验证我的假设,maven使用了错误的版本。
    1 回复  |  直到 11 年前
        1
  •  29
  •   Jose Diaz    15 年前

    默认情况下,在Maven编译器插件中指定正确的JRE版本 pom.xml 文件将从Maven super继承编译器插件 它的目标是1.3JRE。

         <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </plugin>    
            </plugins>
        </build>