I am using Sonar new version with Ant build connectint to Hudson.
I get following error in the console.
The build gets success but at the end it gives a failure on maven! i am only using Sonar-Ant Target. I am not doing anything with pom.
[sonar:sonar] [INFO] Database optimization done: 421 ms BUILD
SUCCESSFUL Total time: 49 seconds [workspace] $ mvn.bat -f
“C:\Documents and
Settings\hegdera.hudson\jobs\ZOOR2\workspace\pom.xml” -e -B
sonar:sonar -Dsonar.host.url=http://localhost:8001
+ Error stacktraces are turned on. [INFO] Scanning for projects… [INFO] Searching repository for plugin with prefix: ‘sonar’. [INFO]
Ignoring available plugin update: 2.0-beta-2 as it requires Maven
version 3.0 [INFO] Ignoring available plugin update: 2.0-beta-1 as it
requires Maven version 3.0 [INFO]
———————————————————————— [INFO] Building Maven Default Project [INFO] task-segment:
[sonar:sonar] (aggregator-style) [INFO]
———————————————————————— [INFO]
———————————————————————— [ERROR] BUILD ERROR [INFO]
———————————————————————— [INFO] Cannot execute mojo: sonar. It requires a project with an
existing pom.xml, but the build is not using one. [INFO]
———————————————————————— [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException:
Cannot execute mojo: sonar. It requires a project with an existing
pom.xml, but the build is not using one. at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.MojoExecutionException: Cannot execute
mojo: sonar. It requires a project with an existing pom.xml, but the
build is not using one. at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:414)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
… 17 more [INFO]
———————————————————————— [INFO] Total time: < 1 second [INFO] Finished at: Fri Jul 15 17:37:18
GMT+05:30 2011 [INFO] Final Memory: 2M/15M [INFO]
———————————————————————— Finished: FAILURE
Anyone help me how to solve this ?
I got it! its done by Sonar Hudson Plugin! its always looking for Maven Pom.xml!