运行Maven2 build时使用不同的Java源代码版本

运行Maven2 build时使用不同的Java源代码版本,java,maven-2,Java,Maven 2,我正在尝试使用通常的方法运行Maven构建: mvn clean install 我收到了一系列错误,如下所示: annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations) 执行构建时如何使用-source 5。我的JAVA_主页指向JDK 1.6。将此添加到pom.xml中: <build> <plugins> <plugi

我正在尝试使用通常的方法运行Maven构建:

mvn clean install
我收到了一系列错误,如下所示:

annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)

执行构建时如何使用-source 5。我的JAVA_主页指向JDK 1.6。

将此添加到pom.xml中:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.3.2</version>
      <configuration>
        <source>1.6</source> 
        <target>1.6</target>
      </configuration>
    </plugin>
  </plugins>
</build>

org.apache.maven.plugins


有关更多信息,请查看pom.xml中的。

。您应该将
1.3
更改为

<source>1.6</source> 
1.6