Hi Kamal,
The configuration for Sonar plugin is explained here:
http://docs.codehaus.org/display/SONAR/Activate+Sonar+on+Jenkins+job
Check topics "Activate Sonar analysis on non-Maven jobs" and "Activate
Sonar analysis by Ant task"
It should help.
Andrey


On Sat, Jul 21, 2012 at 10:30 PM, Kamal Ahmed <kamal2222ah...@yahoo.com>wrote:

> Hi,
> I am trying to run sonar for a test build, but getting the following
> error. Any suggestions on how to resolve this ?
> This project has a build.xml (ant driven) but NO pom.xml, and i think
> sonar supports ant.
>
> [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:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:616)
>       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: Sun Jul 22 00:17:30 EDT 2012
> [INFO] Final Memory: 4M/238M
> [INFO] 
> ------------------------------------------------------------------------
> Sonar analysis completed: FAILURE
> Build step 'Sonar' changed build result to FAILURE
> Build step 'Sonar' marked build as failure
> Notifying upstream projects of job completion
> Finished: FAILURE
>
>

Reply via email to