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

Passing parameters to a Maven project

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      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.

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

              Created:
              Updated:
              Resolved: