File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

maven build error which is strange

 
ashok kumar bommisetty
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below is the maven error I get when i try to execute few test cases in selenium. The error says annotations do not work in 1.3 version but i do not have 1.3 in my system . I have a java version 1.6


C:\Documents and Settings\bomma\workspace\SeleniumControls>mvn clean install -e
-P test-severity-1 -Dtest=**/Test*.java
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Pega UI Testing Framework
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\Documents and Settings\bomma\workspace\SeleniumCont
rols\target
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Documents and Settings\bomma\works
pace\SeleniumControls\src\main\resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 6 source files to C:\Documents and Settings\bomma\workspace\Sel
eniumControls\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

C:\Documents and Settings\bomma\workspace\SeleniumControls\src\main\java\com\peg
a\prpc\api\testcase\SeleniumTestBaseApplication.java:[26,2] annotations are not
supported in -source 1.3
(use -source 5 or higher to enable annotations)
@BeforeClass

C:\Documents and Settings\bomma\workspace\SeleniumControls\src\main\java\com\peg
a\prpc\api\testcase\SeleniumTestBaseApplication.java:[78,14] for-each loops are
not supported in -source 1.3
(use -source 5 or higher to enable for-each loops)
for (char c : LoadPropertyFile.getProperty("prpc.userlogin").toC
harArray()){

C:\Documents and Settings\bomma\workspace\SeleniumControls\src\main\java\com\peg
a\prpc\api\testcase\SeleniumTestBase.java:[3,7] static import declarations are n
ot supported in -source 1.3
(use -source 5 or higher to enable static import declarations)
import static org.junit.Assert.assertEquals;

C:\Documents and Settings\bomma\workspace\SeleniumControls\src\main\java\com\peg
a\prpc\api\testcase\SeleniumTestBase.java:[17,2] annotations are not supported i
n -source 1.3
(use -source 5 or higher to enable annotations)
@BeforeClass


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:715)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
ure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler
Mojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Nov 23 19:25:30 IST 2010
[INFO] Final Memory: 14M/26M
[INFO] ------------------------------------------------------------------------


Check out the java version displayed when i am trying to see the mvn version...

C:\Documents and Settings\bomma\workspace\SeleniumControls>mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-07 00:46:01+0530)
Java version: 1.6.0_06
Java home: C:\Program Files\Java\jdk1.6\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"


Thanks in advance
-Ashok

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maven does not care what version of JDK you are using, it always assumes 1.3 unless you tell it otherwise. You need to specify the source and target as being 1.5 or 1.6. Add this under <build>:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic