<p><span style="font-family: Arial, Helvetica, sans-serif;">[INFO] Scanning for projects...</span></p>[INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building tigase-extension 1.0-alpha1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ tigase-extension --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ tigase-extension --- [INFO] Compiling 8 source files to /home/kevin/Workspace/eclipseWorkspace/tigase-extension/target/classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.947s [INFO] Finished at: Thu May 07 18:23:03 CST 2015 [INFO] Final Memory: 6M/117M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project tigase-extension: Compilation failure: Compilation failure: [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/PushProvider.java:[10,21] error: generics are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable generics) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/TalkKingPushComponent.java:[30,26] error: generics are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable generics) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/TalkKingPushComponent.java:[37,2] error: annotations are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable annotations) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/TalkKingPushComponent.java:[82,38] error: for-each loops are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable for-each loops) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/PushRepository.java:[12,21] error: generics are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable generics) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/DataPushRepository.java:[27,2] error: annotations are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable annotations) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/DataPushRepository.java:[28,21] error: generics are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable generics) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/DataPushRepository.java:[86,52] error: diamond operator is not supported in -source 1.3 [ERROR] [ERROR] (use -source 7 or higher to enable diamond operator) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/TalkKingRoster.java:[40,2] error: annotations are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable annotations) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/TalkKingRoster.java:[48,36] error: generics are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable generics) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/TalkKingRoster.java:[100,26] error: for-each loops are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable for-each loops) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/TalkKingPushNotification.java:[32,2] error: annotations are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable annotations) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/TalkKingPushNotification.java:[33,21] error: generics are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable generics) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/ApnsProvider.java:[29,2] error: annotations are not supported in -source 1.3 [ERROR] [ERROR] (use -source 5 or higher to enable annotations) [ERROR] /home/kevin/Workspace/eclipseWorkspace/tigase-extension/src/main/java/cn/rspread/xmppserver/push/ApnsProvider.java:[30,21] error: generics are not supported in -source 1.3 [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
在<project>标签内添加如下字段。也就是提高maven-compiler-plugin插件的版本
<build> <sourceDirectory>src/main/java</sourceDirectory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build>