Sonar

The name node should not be mandatory in the pom.xml file

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.10
  • Component/s: Maven Plugin
  • Labels:
    None
  • Number of attachments :
    4

Description

It's work fine with no configuration, but when I added the following line in my settings.xml :

<profile>
        <id>sonar</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <sonar.host.url>http://myhostname:9000</sonar.host.url>
        </properties>
    </profile>

I have this exception :

[INFO] [sonar-core:batch]
[ERROR] Cannot execute the command org.codehaus.sonar:sonar-core-maven-plugin:1.7:batch
org.apache.maven.lifecycle.LifecycleExecutionException: Error occured when triggering measures calculation job on remote
 server
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.sonar.maven.SonarMavenEmbedder.execute(SonarMavenEmbedder.java:151)
        at org.sonar.maven.SonarMojo.executeMaven(SonarMojo.java:271)
        at org.sonar.maven.SonarMojo.executeGoals(SonarMojo.java:256)
        at org.sonar.maven.SonarMojo.execute(SonarMojo.java:115)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        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:585)
        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: Error occured when triggering measures calculation job on rem
ote server
        at org.sonar.maven.BatchMojo.doExecute(BatchMojo.java:74)
        at org.sonar.maven.CoreMojo.execute(CoreMojo.java:115)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        ... 27 more
Caused by: org.sonar.commons.ServerApiLaunchBatchFailureException: Fail to launch batch on : http://myhostname:9000/api/server/consolidate_snapshot/286
        at org.sonar.commons.ServerHttpClient.postRemoteContent(ServerHttpClient.java:129)
        at org.sonar.commons.ServerHttpClient.launchBatch(ServerHttpClient.java:88)
        at org.sonar.maven.BatchMojo.notifyServer(BatchMojo.java:83)
        at org.sonar.maven.BatchMojo.doExecute(BatchMojo.java:71)
        ... 30 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute the command org.codehaus.sonar:sonar-core-maven-plugin:1.7:batch

Embedded error: Error occured when triggering measures calculation job on remote server
Fail to launch batch on : http://myhostname:9000/api/server/consolidate_snapshot/286
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 29 seconds
[INFO] Finished at: Thu Apr 09 15:15:30 CEST 2009
[INFO] Final Memory: 19M/85M
[INFO] ------------------------------------------------------------------------
  1. maven-e.log
    04/Jun/09 10:26 AM
    43 kB
    Olivier Ribardière
  2. sonar.log
    10/Apr/09 1:25 AM
    10 kB
    Lilians Auvigne
  3. sonar2.log
    04/Jun/09 10:26 AM
    21 kB
    Olivier Ribardière
  4. SONAR-746-e.log
    10/Apr/09 7:23 AM
    58 kB
    Lilians Auvigne

Issue Links

Activity

Hide
Freddy Mallet added a comment -

Could you confirm that you want to use the default Derby database as no DB configuration is defined in your settings.xml file ? Could you attach to this ticket the /logs/sonar.log file of your Sonar web server ?
Thanks

Show
Freddy Mallet added a comment - Could you confirm that you want to use the default Derby database as no DB configuration is defined in your settings.xml file ? Could you attach to this ticket the /logs/sonar.log file of your Sonar web server ? Thanks
Hide
Lilians Auvigne added a comment -

I confirm, I use the default Derby database on my Sonar Web Server.
So, I think my settings.xml is correct. No ?

Show
Lilians Auvigne added a comment - I confirm, I use the default Derby database on my Sonar Web Server. So, I think my settings.xml is correct. No ?
Hide
Freddy Mallet added a comment -

Looks like the Sonar Maven plugin can't manage to hit the http://myhostname:9000/ server. Could you launch again the Sonar Maven goal but with the option "-e" to get the full stack trace :

mvn org.codehaus.sonar:sonar-maven-goal:1.7:sonar -e

Thanks

Show
Freddy Mallet added a comment - Looks like the Sonar Maven plugin can't manage to hit the http://myhostname:9000/ server. Could you launch again the Sonar Maven goal but with the option "-e" to get the full stack trace :
mvn org.codehaus.sonar:sonar-maven-goal:1.7:sonar -e
Thanks
Hide
Lilians Auvigne added a comment -

The log attached. During this execution, the sonar web server is avalaible.

Show
Lilians Auvigne added a comment - The log attached. During this execution, the sonar web server is avalaible.
Hide
Olivier Ribardière added a comment -

I have exactly the same problem but running Sonar 1.6. I added 2 logs :

  • maven-e.log is the result of the following command
    mvn clean package org.codehaus.sonar:sonar-maven-plugin:1.6:sonar -Dsonar.importurces=false -Dmaven.test.skip=true -e
    I don't think there's anything new in that log
  • sonar2.log : in that log I found some error messages not present in sonar.log from Lilians, it should help investigate.

For your information I have 2 other projects running very well with Sonar but I don't know why this other one fails. My Settings.xml is of course the same for all those projects.

Show
Olivier Ribardière added a comment - I have exactly the same problem but running Sonar 1.6. I added 2 logs :
  • maven-e.log is the result of the following command mvn clean package org.codehaus.sonar:sonar-maven-plugin:1.6:sonar -Dsonar.importurces=false -Dmaven.test.skip=true -e I don't think there's anything new in that log
  • sonar2.log : in that log I found some error messages not present in sonar.log from Lilians, it should help investigate.
For your information I have 2 other projects running very well with Sonar but I don't know why this other one fails. My Settings.xml is of course the same for all those projects.
Hide
Olivier Ribardière added a comment -

Today I checked my pom.xml and I notified that there was no name (<name/>) -> I added a name (<name>My Project name</name>) and it worked !! problem was no more reproducable.
This is a workaround, however I still think that the name should not be mandatory, given that Sonar uses the groupId / artifactId as project identifier.

Show
Olivier Ribardière added a comment - Today I checked my pom.xml and I notified that there was no name (<name/>) -> I added a name (<name>My Project name</name>) and it worked !! problem was no more reproducable. This is a workaround, however I still think that the name should not be mandatory, given that Sonar uses the groupId / artifactId as project identifier.
Hide
Lilians Auvigne added a comment -

Thanks for the workaround

Show
Lilians Auvigne added a comment - Thanks for the workaround
Hide
Simon Brandhof added a comment -

If the node <name> is not set, then the project name is set by maven according to the format : "Unnamed - groupId:artifactId:packaging:version".

This is not really easy to read, so do not forget to name your project ;o)

Show
Simon Brandhof added a comment - If the node <name> is not set, then the project name is set by maven according to the format : "Unnamed - groupId:artifactId:packaging:version". This is not really easy to read, so do not forget to name your project ;o)

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: