Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-312

Passing parameters to a Maven project

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Hi,
      I have a Maven2 project with multi-modules. I have to pass some command line
      parameters so that it builds correctly (currently it is -Dmaven.test.skip=true
      ;o) ) but I will also have to pass some profile configuration.
      If I configure my project using " Build a free-style software project" all is
      fine and running smoothly :o)
      Now if I try "Build a maven2 project (alpha)" it can't build :o(. When I
      configured it I set "clean install -Dmaven.skip.test=true" in the goals field
      (http://myserver/hudson/job/myproject/configure). It fails quite immediately
      when I try to build it with this exception :

      nvalid task '-Dmaven.skip.test=true': you must specify a valid lifecycle phase,
      or a goal in the format plugin:goal or
      pluginGroupId:pluginArtifactId:pluginVersion:goal
      org.apache.maven.BuildFailureException: Invalid task '-Dmaven.skip.test=true':
      you must specify a valid lifecycle phase, or a goal in the format plugin:goal or
      pluginGroupId:pluginArtifactId:pluginVersion:goal
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1510)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:487)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
      at hudson.maven.MavenEmbedder.execute(MavenEmbedder.java:441)
      at hudson.maven.MavenEmbedder.execute(MavenEmbedder.java:382)
      at hudson.maven.MavenBuild$Builder.invoke(MavenBuild.java:150)
      at hudson.maven.MavenBuild$Builder.invoke(MavenBuild.java:111)
      at hudson.FilePath.act(FilePath.java:191)
      at hudson.maven.MavenBuild$RunnerImpl.doRun(MavenBuild.java:243)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:110)
      at hudson.model.Run.run(Run.java:533)
      at hudson.maven.MavenBuild.run(MavenBuild.java:102)
      at hudson.model.Executor.run(Executor.java:61)

      so it looks like "-Dmaven.skip.test=true" is the issue. I think that this
      element should be in the properties parameter when creating the MavenSession. So
      there maybe a properties field missing or the parsing of the goals field should
      be improved.

        Attachments

          Activity

          ehsavoie ehsavoie created issue -
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          This should work in 1.85.

          We might want to provide a better UI for specifying properties, rather than just
          passing them all in one text field, but I guess that should be a separate issue.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - This should work in 1.85. We might want to provide a better UI for specifying properties, rather than just passing them all in one text field, but I guess that should be a separate issue.
          kohsuke Kohsuke Kawaguchi made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          abayer Andrew Bayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          ircbot Jenkins IRC Bot made changes -
          Component/s core [ 15593 ]
          Component/s www [ 15484 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 130385 ] JNJira + In-Review [ 199765 ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ehsavoie ehsavoie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: