jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-294

Removing a maven submodule causes error with sonar

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.3
  • Fix Version/s: 1.4
  • Component/s: Maven Plugin
  • Labels:
    None
  • Environment:
    Maven 2.0.9
    Sonar 1.3

Description

We have this maven project tree :
adminportal

  • adminportal-dao
  • adminportal-serviceportal
  • api
  • clientside
  • serverside

We have been using sonar for 2 weeks without problem.

Our api module does not contain relevant code (only interface and empty beans)
so we want to exclude this module from sonar (as we can not filter classes or projects).
We created a specific profile for sonar excluding this api module.

Now we have this error even after deleting the project in sonar web application.

[INFO] [sonar-core:collect]
[INFO] snapshot com.vsct.admin.portal:adminportal-services-common:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-dao:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-servicesecurity-clientside:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-serviceportal-clientside:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-cas:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-web:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-servicesecurity-serverside:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] snapshot com.vsct.admin.portal:adminportal-serviceportal-serverside:0.0.1-SNAPSHOT: checking for updates from sonar
[INFO] ------------------------------------------------------------------------
[INFO] Building Admin Portal Parent
[INFO] task-segment: [org.codehaus.sonar:sonar-core-maven-plugin:1.3:batch] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] snapshot org.codehaus.sonar.extensions.runtime:jdbc-driver:1.0-SNAPSHOT: checking for updates from sonar
[INFO] [sonar-core:batch]
[ERROR] Cannot execute the command org.codehaus.sonar:sonar-core-maven-plugin:1.3: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.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at ch.hortis.sonar.mvn.SonarMavenEmbedder.execute(SonarMavenEmbedder.java:151)
at ch.hortis.sonar.mvn.SonarMojo.executeMaven(SonarMojo.java:242)
at ch.hortis.sonar.mvn.SonarMojo.executeGoals(SonarMojo.java:225)
at ch.hortis.sonar.mvn.SonarMojo.execute(SonarMojo.java:110)
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.java: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 remote server
at ch.hortis.sonar.mvn.BatchLaunchMojo.doExecute(BatchLaunchMojo.java:80)
at ch.hortis.sonar.mvn.CoreMojo.execute(CoreMojo.java:121)
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.apache.maven.plugin.MojoExecutionException: Unable to find module api in reactor projects
at ch.hortis.sonar.mvn.BatchLaunchMojo.saveSnapshotHierarchyModules(BatchLaunchMojo.java:144)
at ch.hortis.sonar.mvn.BatchLaunchMojo.processSnapshot(BatchLaunchMojo.java:123)
at ch.hortis.sonar.mvn.BatchLaunchMojo.saveSnapshotHierarchyModules(BatchLaunchMojo.java:146)
at ch.hortis.sonar.mvn.BatchLaunchMojo.processSnapshot(BatchLaunchMojo.java:123)
at ch.hortis.sonar.mvn.BatchLaunchMojo.processSnapshots(BatchLaunchMojo.java:105)
at ch.hortis.sonar.mvn.BatchLaunchMojo.doExecute(BatchLaunchMojo.java:68)
... 30 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute the command org.codehaus.sonar:sonar-core-maven-plugin:1.3:batch

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    test-sonar.zip
    27/Jun/08 10:52 AM
    4 kB
    Manuel EVENO
    1. XML File
      test-sonar/module1/api/pom.xml 0.5 kB
    2. Java Source File
      test-sonar/module1/.../HelloService.java 0.1 kB
    3. XML File
      test-sonar/module1/pom.xml 1 kB
    4. XML File
      test-sonar/module1/server/pom.xml 0.7 kB
    5. Java Source File
      test-sonar/module1/.../HelloServiceImpl.java 0.1 kB
    6. XML File
      test-sonar/pom.xml 1 kB
    Download Zip
    Show
    Zip Archive
    test-sonar.zip
    27/Jun/08 10:52 AM
    4 kB
    Manuel EVENO

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Manuel EVENO added a comment - 27/Jun/08 5:13 AM

Sorry the maven project tree does not render correctly :
adminportal

  • adminportal-dao
  • adminportal-serviceportal
    • api
    • clientside
    • serverside
Show
Manuel EVENO added a comment - 27/Jun/08 5:13 AM Sorry the maven project tree does not render correctly : adminportal
  • adminportal-dao
  • adminportal-serviceportal
    • api
    • clientside
    • serverside
Hide
Permalink
Simon Brandhof added a comment - 27/Jun/08 5:25 AM

I can't reproduce this issue. Could you give me the XML of the profile sonar where you exclude api please ?

Show
Simon Brandhof added a comment - 27/Jun/08 5:25 AM I can't reproduce this issue. Could you give me the XML of the profile sonar where you exclude api please ?
Hide
Permalink
Manuel EVENO added a comment - 27/Jun/08 7:32 AM

Ok Here is the parent pom and the pom of the adminportal-serviceportal module (attached to the issue).

Same profile name exists in the parent pom and the adminportal-serviceportal module.

Sonar is invoked via Hudson using the command :
mvn -Phudson,sonar clean org.codehaus.sonar:sonar-maven-plugin:sonar

The mvn -Phudson,sonar clean install works properly.

Show
Manuel EVENO added a comment - 27/Jun/08 7:32 AM Ok Here is the parent pom and the pom of the adminportal-serviceportal module (attached to the issue). Same profile name exists in the parent pom and the adminportal-serviceportal module. Sonar is invoked via Hudson using the command : mvn -Phudson,sonar clean org.codehaus.sonar:sonar-maven-plugin:sonar The mvn -Phudson,sonar clean install works properly.
Hide
Permalink
Manuel EVENO added a comment - 27/Jun/08 7:35 AM

Sorry again, the complete maven command is:

mvn -Phudson,sonar clean org.codehaus.sonar:sonar-maven-plugin:sonar -Dsonar.skipInstall=true

Show
Manuel EVENO added a comment - 27/Jun/08 7:35 AM Sorry again, the complete maven command is: mvn -Phudson,sonar clean org.codehaus.sonar:sonar-maven-plugin:sonar -Dsonar.skipInstall=true
Hide
Permalink
Manuel EVENO added a comment - 27/Jun/08 10:52 AM

Here is a simple test case with fewer and simpler maven project.

First, run a sonar-install, (should be successful)
Second, comment the modules declaration and uncomment the profiles declaration.
Then run a sonar-install again, the previously given exception should happens.

Thanks for your concern !

Show
Manuel EVENO added a comment - 27/Jun/08 10:52 AM Here is a simple test case with fewer and simpler maven project. First, run a sonar-install, (should be successful) Second, comment the modules declaration and uncomment the profiles declaration. Then run a sonar-install again, the previously given exception should happens. Thanks for your concern !
Hide
Permalink
Simon Brandhof added a comment - 09/Jul/08 8:36 AM

Thank you Manuel for your sample. Finally I reproduce the bug. It will be fixed on 1.4 but a new mvn parameter will be developed on 1.5 to exclude some modules, avoiding the workaround with profiles. Something like -Dsonar.skipModules=xxx,yyy,...

For your information you can remove the following useless node from your pom :

<reporting>
				<plugins>
					<plugin>
						<groupId>org.codehaus.sonar</groupId>
						<artifactId>sonar-maven-plugin</artifactId>
						<version>1.3</version>
					</plugin>
				</plugins>
			</reporting>
Show
Simon Brandhof added a comment - 09/Jul/08 8:36 AM Thank you Manuel for your sample. Finally I reproduce the bug. It will be fixed on 1.4 but a new mvn parameter will be developed on 1.5 to exclude some modules, avoiding the workaround with profiles. Something like -Dsonar.skipModules=xxx,yyy,... For your information you can remove the following useless node from your pom :
<reporting>
				<plugins>
					<plugin>
						<groupId>org.codehaus.sonar</groupId>
						<artifactId>sonar-maven-plugin</artifactId>
						<version>1.3</version>
					</plugin>
				</plugins>
			</reporting>
Hide
Permalink
Simon Brandhof added a comment - 09/Jul/08 9:07 AM

Fixed. Functional test described in http://docs.codehaus.org/display/SONAR/Functional+tests.

Show
Simon Brandhof added a comment - 09/Jul/08 9:07 AM Fixed. Functional test described in http://docs.codehaus.org/display/SONAR/Functional+tests.

People

  • Assignee:
    Simon Brandhof
    Reporter:
    Manuel EVENO
Vote (0)
Watch (1)

Dates

  • Created:
    27/Jun/08 5:12 AM
    Updated:
    25/Sep/08 3:46 AM
    Resolved:
    09/Jul/08 9:07 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.