The following prompt always appears during Maven packaging:
1.-source 1.3 does not support generics (use-source 5 or later to enable generics) List <user> userlist = new arraylist <user> ();
2.-source 1.3 does not support annotation (use-source 5 or later to enable annotation) @ WebService (endpointinterface = "com. WebService. Service. loadservice ")
Run the MVN-V command to view the result:
C: \ Users \ Administrator> MVN-V Apache Maven 2.2.1 (r801777; 03:16:01 + 0800) Java version: 1.6.0 Java home: D: \ Program Files \ Java \ jdk1.6.0 \ JRE Default locale: zh_cn, platform encoding: GBK OS name: "Windows Vista" version: "6.1" arch: "x86" Family: "Windows" |
Obviously it has nothing to do with the configured JDK.
Final Solution:
In the project Pom. XML, add
<Build> <Plugins> <Plugin> <Groupid> org. Apache. Maven. plugins </groupid> <Artifactid> Maven-compiler-plugin </artifactid> <Configuration> <Sources> 1.5 </source> <Target> 1.5 </Target> </Configuration> </Plugin> </Plugins> </Build> |
Run MVN install, OK.
Forward: The following prompt always appears during Maven packaging:-source 1.3 does not support generics (use-source 5 or later to enable generics)