Maven
  1. Maven
  2. MNG-4001

Unable to resolve Dashboard mojo from Central

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.9
    • Fix Version/s: None
    • Component/s: Sites & Reporting
    • Labels:
      None
    • Environment:
      Windows, JDK 1.6
    • Complexity:
      Intermediate
    • Number of attachments :
      1

      Description

      I have a simple test project that declares the dashboard-maven-plugin (see http://mojo.codehaus.org/dashboard-maven-plugin/usage.html ).

      Note that the usage does explicitly state that the Codehaus repository must be specified as a plugin repository...
      However, according to: http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html
      I'm pretty sure that Maven should be able to resolve the dashboard-maven-plugin from the central repo.

      I validated that the dashboard-maven-plugin residing in central is indeed the same artifact as that which lives at the codehaus repository.

      But as you can see from my attached test case, the codehaus mojo is NOT being resolved without the special plugin repository defined. When running

      mvn dashboard:dashboard

      , I get the following error message:

      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'dashboard'.
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] The plugin 'org.apache.maven.plugins:maven-dashboard-plugin' does not exist or no valid version could be found
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: < 1 second
      [INFO] Finished at: Sat Jan 24 12:40:55 PST 2009
      [INFO] Final Memory: 1M/254M
      [INFO] ------------------------------------------------------------------------

      If you edit the pom.xml to uncomment out the plugin repository declaration for codehaus, it works as one would expect.

      My understanding is that the only reason why the Dashboard Usage mentions their plugin repository is because the artifact was not available on the central repository – but it certainly is today.

      I also thought that perhaps the maven-metadata.xml might be incorrect (perhaps the dashboard plugin prefix is missing or different). I checked:

      and they both look OK to me... I clearly see:

      <plugin>
          <name>Maven Dashboard Report Plugin</name> 
          <prefix>dashboard</prefix> 
          <artifactId>dashboard-maven-plugin</artifactId> 
      </plugin>
      

      And I don't see any plugin with a dashboard prefix specified as an Apache Maven Plugin here:

      If I explicitly specify the dashboard plugin like:

      mvn org.codehaus.mojo:dashboard-maven-plugin:dashboard

      that works...

      Overall, I am recording a bug because the documentation states:

      Maven will always search the following groupId's after searching any plugin groups specified in the user's settings:

      • org.apache.maven.plugins
      • org.codehaus.mojo

      I don't see this being done.

      Finally, I even tried adding a pluginGroups to my settings.xml:

      <pluginGroups>
        <pluginGroup>org.codehaus.mojo</pluginGroup>
      </pluginGroups>
      

      But that did not work either...

        Activity

        Hide
        Brett Porter added a comment -

        this is because the mojo is not listed here:

        http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml

        for it to work from the command-line without a metadata entry, it must be listed in the <build> section, not the <reporting> section (which is only triggered during the 'site' lifecycle).

        Show
        Brett Porter added a comment - this is because the mojo is not listed here: http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml for it to work from the command-line without a metadata entry, it must be listed in the <build> section, not the <reporting> section (which is only triggered during the 'site' lifecycle).
        Hide
        Anthony Whitford added a comment -

        I am looking at http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml and I clearly see:

        <plugin>
          <name>Maven Dashboard Report Plugin</name>
          <prefix>dashboard</prefix>
          <artifactId>dashboard-maven-plugin</artifactId>
        </plugin>
        

        So why are you saying it isn't there?

        Show
        Anthony Whitford added a comment - I am looking at http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml and I clearly see: <plugin> <name> Maven Dashboard Report Plugin </name> <prefix> dashboard </prefix> <artifactId> dashboard-maven-plugin </artifactId> </plugin> So why are you saying it isn't there?
        Hide
        Brett Porter added a comment -

        I used find in the browser, it appears doesn't work on rendered xml files

        Does it also appear in your local repository at the same location? If so, it should certainly work.

        Show
        Brett Porter added a comment - I used find in the browser, it appears doesn't work on rendered xml files Does it also appear in your local repository at the same location? If so, it should certainly work.
        Hide
        Anthony Whitford added a comment -

        OK, I traced the problem due to:

        • .m2\repository\org\codehaus\mojo\maven-metadata-central.xml

        I had to nuke my local repo's mojo directory to force a re-download.

        So while I agree there was a metadata problem in my local repository, I still think there is a TODO for Maven because there isn't really a command to force an update of this file (and even detection that it is out of date). (Or is there?) I tried mvn -cpu, but that doesn't refresh the bad maven-metadata-central.xml file.

        Show
        Anthony Whitford added a comment - OK, I traced the problem due to: .m2\repository\org\codehaus\mojo\maven-metadata-central.xml I had to nuke my local repo's mojo directory to force a re-download. So while I agree there was a metadata problem in my local repository, I still think there is a TODO for Maven because there isn't really a command to force an update of this file (and even detection that it is out of date). (Or is there?) I tried mvn -cpu , but that doesn't refresh the bad maven-metadata-central.xml file.
        Hide
        Brett Porter added a comment -

        thanks, that does seem like a bug

        Show
        Brett Porter added a comment - thanks, that does seem like a bug
        Hide
        Freddy Mallet added a comment -

        Hi Brett, we encounter the same issue with the Sonar Mojo.

        Show
        Freddy Mallet added a comment - Hi Brett, we encounter the same issue with the Sonar Mojo .
        Hide
        Hai Phan added a comment -

        Hi All,
        I am new to Sonar. Please help out.
        I got the following error when running the mvn sonar:sonar command

        [INFO] Scanning for projects...
        [INFO] Searching repository for plugin with prefix: 'sonar'.
        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 1 second
        [INFO] Finished at: Thu Jun 11 17:29:49 CDT 2009
        [INFO] Final Memory: 6M/42M
        [INFO] ------------------------------------------------------------------------
        

        Running this goal mvn org.codehaus.sonar:sonar-maven-plugin:1.9.2:sonar gives the following errors

        [INFO] Error building POM (may not be this project's POM).
        
        
        Project ID: org.codehaus.sonar:sonar-maven-plugin
        
        Reason: POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any reposit
        ory
        
          org.codehaus.sonar:sonar-maven-plugin:pom:1.9.2
        

        Look like it is trying to download the sonar-maven-plugin-1.9.2.jar but couldn't find it anywhere. I did remove all the org\codehaus\mojo from my local + remote repos but the problem still exists. Please help...

        Regards,
        Hai

        Show
        Hai Phan added a comment - Hi All, I am new to Sonar. Please help out. I got the following error when running the mvn sonar:sonar command [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'sonar'. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO] Finished at: Thu Jun 11 17:29:49 CDT 2009 [INFO] Final Memory: 6M/42M [INFO] ------------------------------------------------------------------------ Running this goal mvn org.codehaus.sonar:sonar-maven-plugin:1.9.2:sonar gives the following errors [INFO] Error building POM (may not be this project's POM). Project ID: org.codehaus.sonar:sonar-maven-plugin Reason: POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any reposit ory org.codehaus.sonar:sonar-maven-plugin:pom:1.9.2 Look like it is trying to download the sonar-maven-plugin-1.9.2.jar but couldn't find it anywhere. I did remove all the org\codehaus\mojo from my local + remote repos but the problem still exists. Please help... Regards, Hai
        Hide
        Christian Dehning added a comment -

        Hello there,

        Deleting the org/codehaus/mojo folder only works sometimes for me, so i tried out, which file or folder exactly is the one causing the whole plugin to break.

        For your information:
        I'm using Hudson 1.329 and Sonar 1.11.

        When I launch my builds, i sometimes get the following messages:

        [INFO] Scanning for projects...
        [INFO] Searching repository for plugin with prefix: 'sonar'.
        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found
        [INFO] ------------------------------------------------------------------------
        [INFO] Trace
        org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1568)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1808)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:446)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:176)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
        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.version.PluginVersionNotFoundException: The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found
        at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
        at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
        at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:172)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1539)
        ... 15 more

        To fix this, i only have to replace this file:
        org/codehaus/mojo/sonar-maven-plugin/maven-metadata-central.xml

        I don't know what is changing this file and causes all my builds to crash, but somehow, the whole version and versioning tags get deleted!

        This is how the file looks like, when the builds work:

        <?xml version="1.0" encoding="UTF-8"?>
        <metadata>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>1.0-beta-1</version>
        <versioning>
        <latest>1.0-beta-1</latest>
        <release>1.0-beta-1</release>
        <versions>
        <version>1.0-beta-1</version>
        </versions>
        <lastUpdated>20090422092422</lastUpdated>
        </versioning>
        </metadata>

        And this is how it looks like, when I get those error-messages from above:

        <?xml version="1.0" encoding="UTF-8"?>
        <metadata>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        </metadata>

        That may explain, why I get the message "The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found", because there is no more version entry in this xml-file!

        I think following question is the one the has to be answered: What is changing the maven-metadata-central.xml file of the sonar-maven-plugin by deleting those tags?

        I hope this helps you to fix this bug!

        Cheers,
        Christian Dehning

        Show
        Christian Dehning added a comment - Hello there, Deleting the org/codehaus/mojo folder only works sometimes for me, so i tried out, which file or folder exactly is the one causing the whole plugin to break. For your information: I'm using Hudson 1.329 and Sonar 1.11. When I launch my builds, i sometimes get the following messages: [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'sonar'. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1568) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1808) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:446) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:176) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41) 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.version.PluginVersionNotFoundException: The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229) at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91) at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:172) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1539) ... 15 more To fix this, i only have to replace this file: org/codehaus/mojo/sonar-maven-plugin/maven-metadata-central.xml I don't know what is changing this file and causes all my builds to crash, but somehow, the whole version and versioning tags get deleted! This is how the file looks like, when the builds work: <?xml version="1.0" encoding="UTF-8"?> <metadata> <groupId>org.codehaus.mojo</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>1.0-beta-1</version> <versioning> <latest>1.0-beta-1</latest> <release>1.0-beta-1</release> <versions> <version>1.0-beta-1</version> </versions> <lastUpdated>20090422092422</lastUpdated> </versioning> </metadata> And this is how it looks like, when I get those error-messages from above: <?xml version="1.0" encoding="UTF-8"?> <metadata> <groupId>org.codehaus.mojo</groupId> <artifactId>sonar-maven-plugin</artifactId> </metadata> That may explain, why I get the message "The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found", because there is no more version entry in this xml-file! I think following question is the one the has to be answered: What is changing the maven-metadata-central.xml file of the sonar-maven-plugin by deleting those tags? I hope this helps you to fix this bug! Cheers, Christian Dehning
        Hide
        Peter Lynch added a comment -

        Perhaps when this is fixed, adding an DEBUG log message indicating which groupIds were checked to try to find the plugin in the metadata would set one's mind at ease. All I see now is remote checks to central for the 'org.apache.maven.plugins' version of the plugin which is obviously not helpful.

        Show
        Peter Lynch added a comment - Perhaps when this is fixed, adding an DEBUG log message indicating which groupIds were checked to try to find the plugin in the metadata would set one's mind at ease. All I see now is remote checks to central for the 'org.apache.maven.plugins' version of the plugin which is obviously not helpful.
        Hide
        Peter Lynch added a comment - - edited

        Try this for extra wackiness:

        Define your plugin configuration for a org.codehaus.mojo plugin in pluginManagement without the groupId. Next, define the same plugin in a profile with the groupId and without configuration.

        Run a mvn cmd that activates the profile and you will notice that none of your plugin settings inside pluginManagement gets picked up - and of course there is no warning or messages in the debug output that complain.

        Finally add the groupId org.codehaus.mojos to the pluginManagement section for the same plugin and it all of a sudden the plugin in the profile picks up the configuration.

        Show
        Peter Lynch added a comment - - edited Try this for extra wackiness: Define your plugin configuration for a org.codehaus.mojo plugin in pluginManagement without the groupId. Next, define the same plugin in a profile with the groupId and without configuration. Run a mvn cmd that activates the profile and you will notice that none of your plugin settings inside pluginManagement gets picked up - and of course there is no warning or messages in the debug output that complain. Finally add the groupId org.codehaus.mojos to the pluginManagement section for the same plugin and it all of a sudden the plugin in the profile picks up the configuration.
        Hide
        Freddy Mallet added a comment -

        I would have preferred a "won't fix" resolution type instead of "Not a bug" as this is clearly a bug which is enough annoying to be referenced in the Sonar FAQ.
        Thanks
        Freddy

        Show
        Freddy Mallet added a comment - I would have preferred a "won't fix" resolution type instead of "Not a bug" as this is clearly a bug which is enough annoying to be referenced in the Sonar FAQ . Thanks Freddy
        Hide
        Klaus Brunner added a comment -

        This issue needs to be re-opened. It's still there with the most recent release of Maven (2.2.1), and it's unclear why it first is confirmed as a bug and then simply labeled "not a bug" without further comment.

        Show
        Klaus Brunner added a comment - This issue needs to be re-opened. It's still there with the most recent release of Maven (2.2.1), and it's unclear why it first is confirmed as a bug and then simply labeled "not a bug" without further comment.
        Hide
        Andrew Ferguson added a comment -

        We're experiencing this issue with Sonar as well, and it's becoming a reasonably serious problem. I'd also like to know why this was closed as 'Not A Bug' without comment when, as Freddy pointed out, the issue is serious enough to be mentioned in the Sonar FAQ.

        Show
        Andrew Ferguson added a comment - We're experiencing this issue with Sonar as well, and it's becoming a reasonably serious problem. I'd also like to know why this was closed as 'Not A Bug' without comment when, as Freddy pointed out, the issue is serious enough to be mentioned in the Sonar FAQ.
        Hide
        Arnaud Heritier added a comment -

        As asked by users we reopen it to reanalyze it and close it as won't fix if necessary. Is there someone who can try to reproduce it with maven 3 ?

        Show
        Arnaud Heritier added a comment - As asked by users we reopen it to reanalyze it and close it as won't fix if necessary. Is there someone who can try to reproduce it with maven 3 ?
        Hide
        Freddy Mallet added a comment -

        Hi Arnaud, here is the steps to reproduce this issue with Maven 2 :

        • Launch successfully "mvn sonar:sonar" or whatever Codehaus Mojo plugin
        • Edit locally the following file .m2\repository\org\codehaus\mojo\maven-metadata-central.xml to suppress the declaration of the plugin (Sonar in the example)
        • Launching "mvn sonar:sonar" without or without "-cpu" options fails

        After several tests, seems like this bug is fixed with Maven 3.

        Show
        Freddy Mallet added a comment - Hi Arnaud, here is the steps to reproduce this issue with Maven 2 : Launch successfully "mvn sonar:sonar" or whatever Codehaus Mojo plugin Edit locally the following file .m2\repository\org\codehaus\mojo\maven-metadata-central.xml to suppress the declaration of the plugin (Sonar in the example) Launching "mvn sonar:sonar" without or without "-cpu" options fails After several tests, seems like this bug is fixed with Maven 3.
        Hide
        Brett Porter added a comment -

        putting this into 2.2.2 in case anyone is able to review / offer a patch. If not, we may return to closing it out as solved in Maven 3.

        Show
        Brett Porter added a comment - putting this into 2.2.2 in case anyone is able to review / offer a patch. If not, we may return to closing it out as solved in Maven 3.
        Hide
        Freddy Mallet added a comment -

        That'ok for me Brett to close this ticket out as solved in Maven 3.

        Show
        Freddy Mallet added a comment - That'ok for me Brett to close this ticket out as solved in Maven 3.
        Hide
        André Ribeiro added a comment - - edited

        This should be fixed in 2.2.x, some organizations cannot afford to switch to version 3 just like that.

        Show
        André Ribeiro added a comment - - edited This should be fixed in 2.2.x, some organizations cannot afford to switch to version 3 just like that.
        Hide
        stephen hartley added a comment -

        +1 request to fix in 2.2.x, the hudson sonar plugin uses maven 2.2.1 which means sonar:sonar fails in my CI environment

        Show
        stephen hartley added a comment - +1 request to fix in 2.2.x, the hudson sonar plugin uses maven 2.2.1 which means sonar:sonar fails in my CI environment
        Show
        Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014
        Hide
        Jason van Zyl added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          People

          • Assignee:
            Unassigned
            Reporter:
            Anthony Whitford
          • Votes:
            17 Vote for this issue
            Watchers:
            16 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: