hadoop - Why is Maven trying to compile my code as -source 1.3? -
i error mvn -e package
in ubuntu 12.04:
[error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project hadoopskeleton: compilation failure: compilation failure: [error] /home/jesvin/dev/hadoop/hadoopmahoutskeleton-master/src/main/java/hadoopskeleton/app.java:[22,8] error: generics not supported in -source 1.3 [error] [error] (use -source 5 or higher enable generics) [error] /home/jesvin/dev/hadoop/hadoopmahoutskeleton-master/src/main/java/hadoopskeleton/app.java:[53,28] error: for-each loops not supported in -source 1.3 [error] -> [help 1] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project hadoopskeleton: compilation failure @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:213) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:84) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:59) @ org.apache.maven.lifecycle.internal.lifecyclestarter.singlethreadedbuild(lifecyclestarter.java:183) @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:161) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:320) @ org.apache.maven.defaultmaven.execute(defaultmaven.java:156) @ org.apache.maven.cli.mavencli.execute(mavencli.java:537) @ org.apache.maven.cli.mavencli.domain(mavencli.java:196) @ org.apache.maven.cli.mavencli.main(mavencli.java:141) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ org.codehaus.plexus.classworlds.launcher.launcher.launchenhanced(launcher.java:290) @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:230) @ org.codehaus.plexus.classworlds.launcher.launcher.mainwithexitcode(launcher.java:409) @ org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:352) caused by: org.apache.maven.plugin.compilationfailureexception: compilation failure @ org.apache.maven.plugin.abstractcompilermojo.execute(abstractcompilermojo.java:516) @ org.apache.maven.plugin.compilermojo.execute(compilermojo.java:114) @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:101) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:209) ... 19 more [error] [error] re-run maven using -x switch enable full debug logging. [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojofailureexception
so guess maven forced compile against older version of java. why doing so? want maven configuration builds mahout jars.
<dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.11</version> <scope>test</scope> </dependency> <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-core</artifactid> <version>1.0.4</version> <!-- or whatever version --> </dependency> <dependency> <groupid>org.apache.mahout</groupid> <artifactid>mahout-core</artifactid> <version>0.7</version> </dependency> </dependencies>
i trying build https://github.com/yeahiii/hadoopmahoutskeleton/blob/master/pom.xml
java version "1.7.0_21" java(tm) se runtime environment (build 1.7.0_21-b11) java hotspot(tm) server vm (build 23.21-b01, mixed mode)
use maven compiler plugin
<plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins>
Comments
Post a Comment