Continuum
  1. Continuum
  2. CONTINUUM-1874

continuum:add-maven-two-project doesn't work

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2.1
    • Component/s: Maven Plugin
    • Labels:
      None
    • Environment:
      JDK1.5, Maven 2.0.9, Continuum 1.2
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      When doing a:

      $ mvn org.apache.continuum:continuum-maven-plugin:1.2:add-maven-two-project -Durl=http://localhost:9090/xmlrpc -Dusername=admin -Dpassword=******
      

      I get something like this:

      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Building quickstart
      [INFO]    task-segment: [org.apache.continuum:continuum-maven-plugin:1.2:add-maven-two-project]
      [INFO] ------------------------------------------------------------------------
      [INFO] [continuum:add-maven-two-project]
      [ERROR] fail to add mavenTwo project add.project.project.building.error
      
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] fail to add mavenTwo project add.project.project.building.error
      
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5 seconds
      [INFO] Finished at: Tue Sep 09 20:55:57 PHT 2008
      [INFO] Final Memory: 10M/83M
      [INFO] ------------------------------------------------------------------------
      $
      

      In AddMavenTwoProject.java, it defines the pom url as only the containing directory of the pom.xml:

      /**
        * POM Url.
        *
        * @parameter expression="${projectUrl}" default-value="${project.scm.url}"
        * @required
        */
      private String projectUrl;
      

      I tried appending a /pom.xml in the default-value, and I was able to add the project then.

      /**
        * POM Url.
        *
        * @parameter expression="${projectUrl}" default-value="${project.scm.url}/pom.xml"
        * @required
        */
      private String projectUrl;
      
      $ mvn org.apache.continuum:continuum-maven-plugin:1.2:add-maven-two-project -Durl=http://localhost:9090/xmlrpc -Dusername=admin -Dpassword=******
      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Building quickstart
      [INFO]    task-segment: [org.apache.continuum:continuum-maven-plugin:1.2:add-maven-two-project]
      [INFO] ------------------------------------------------------------------------
      [INFO] [continuum:add-maven-two-project]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 8 seconds
      [INFO] Finished at: Tue Sep 09 21:31:43 PHT 2008
      [INFO] Final Memory: 10M/82M
      [INFO] ------------------------------------------------------------------------
      $
      

      At first, I thought it fixed the problem. But when I tried adding a multi-module project, e.g.:

      multimodule-parent/pom.xml
        | 
        +--submodule-one/pom.xml
        | 
        +--submodule-two/pom.xml
        | 
        +--submodule-three/pom.xml
      

      Continuum added the project defined by multimodule-parent/pom.xml four times.

        Activity

        Hide
        Olivier Lamy added a comment -

        Hi,
        I don't want to add pom.xml in the default-value : users can have the rigth one and it will fail.
        Concerning the multi modules, you can certainly try using -N when using the continuum plugin.

        Show
        Olivier Lamy added a comment - Hi, I don't want to add pom.xml in the default-value : users can have the rigth one and it will fail. Concerning the multi modules, you can certainly try using -N when using the continuum plugin.
        Hide
        Nap Ramirez added a comment -

        How about using a default value if the project url doesn't end in .xml? For example, if the url is something like http://myhost.com/repos/myproject/trunk, the plugin should append the missing default pom.xml. But if it is something like http://myhost.com/repos/myproject/trunk/custom-pom.xml, then the plugin shouldn't override it.

        I tried:

        $ mvn org.apache.continuum:continuum-maven-plugin:1.2-SNAPSHOT:add-maven-two-project -o -Durl=http://localhost:9090/xmlrpc -Dusername=admin -Dpassword=****** -N
        [INFO] Scanning for projects...
        [INFO] ------------------------------------------------------------------------
        [INFO] Building multimodule-parent
        [INFO]    task-segment: [org.apache.continuum:continuum-maven-plugin:1.2-SNAPSHOT:add-maven-two-project]
        [INFO] ------------------------------------------------------------------------
        [INFO] [continuum:add-maven-two-project]
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESSFUL
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 8 seconds
        [INFO] Finished at: Thu Sep 11 13:55:16 PHT 2008
        [INFO] Final Memory: 10M/82M
        [INFO] ------------------------------------------------------------------------
        $
        

        ..and continuum added just the parent.

        Show
        Nap Ramirez added a comment - How about using a default value if the project url doesn't end in .xml? For example, if the url is something like http://myhost.com/repos/myproject/trunk , the plugin should append the missing default pom.xml. But if it is something like http://myhost.com/repos/myproject/trunk/custom-pom.xml , then the plugin shouldn't override it. I tried: $ mvn org.apache.continuum:continuum-maven-plugin:1.2-SNAPSHOT:add-maven-two-project -o -Durl=http://localhost:9090/xmlrpc -Dusername=admin -Dpassword=****** -N [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building multimodule-parent [INFO] task-segment: [org.apache.continuum:continuum-maven-plugin:1.2-SNAPSHOT:add-maven-two-project] [INFO] ------------------------------------------------------------------------ [INFO] [continuum:add-maven-two-project] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8 seconds [INFO] Finished at: Thu Sep 11 13:55:16 PHT 2008 [INFO] Final Memory: 10M/82M [INFO] ------------------------------------------------------------------------ $ ..and continuum added just the parent.
        Hide
        Emmanuel Venisse added a comment -

        Fixed.
        Committed in r.699173

        I fixed the plugin so you'll can run it like you already do it and I add a pomFilename parameter that is defaulted to 'pom.xml'

        Show
        Emmanuel Venisse added a comment - Fixed. Committed in r.699173 I fixed the plugin so you'll can run it like you already do it and I add a pomFilename parameter that is defaulted to 'pom.xml'

          People

          • Assignee:
            Emmanuel Venisse
            Reporter:
            Nap Ramirez
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: