Maven不会编译Java注释吗?

时间:2011-10-28 15:37:55

标签: java maven compilation annotations

我无法让maven编译使用Java注释的项目。我收到以下错误消息:

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

在我的POM中,我有以下编译器插件,所以首先从哪里获取-source 1.3?

        <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>

我怀疑我可能错过了一些非常简单的工作,但谷歌搜索错误并没有带来任何帮助

非常感谢任何帮助

1 个答案:

答案 0 :(得分:2)

确保您的<plugin>元素位于<build>部分内,而不仅仅是<pluginManagement><reporting>部分。