Maven Deploy Plugin
  1. Maven Deploy Plugin
  2. MDEPLOY-181

DeployAtEnd cannot be overwritten from command line using -DdeployAtEnd=false

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: 2.8.1
    • Fix Version/s: None
    • Component/s: deploy:deploy
    • Labels:
      None
    • Environment:
      Maven 3.2.1 on Mac OSX 10.9.2

      Description

      1. Declare the maven-deploy-plugin and as configuration, add <deployAtEnd>true</deployAtEnd>.

      2. Override deployAtEnd property using the command line argument '-DdeployAtEnd=false'.

      3. Deploy plugin still wants to deploy all artifacts at the end.

      Expected behaviour:
      Deploy plugin honors command line argument '-DdeployAtEnd=false'.

        Activity

        Hide
        Robert Scholte added a comment -

        Please verify with -X that the plugin configuration does have the deployAtEnd parameter with value false

        Show
        Robert Scholte added a comment - Please verify with -X that the plugin configuration does have the deployAtEnd parameter with value false
        Hide
        Karl Heinz Marbaise added a comment -

        I have checked the output via a test case which produces this:

        [DEBUG] -----------------------------------------------------------------------
        [DEBUG] Goal:          org.apache.maven.plugins:maven-deploy-plugin:2.9-SNAPSHOT:deploy (default-deploy)
        [DEBUG] Style:         Regular
        [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
        <configuration>
          <altDeploymentRepository>${altDeploymentRepository}</altDeploymentRepository>
          <altReleaseDeploymentRepository>${altReleaseDeploymentRepository}</altReleaseDeploymentRepository>
          <altSnapshotDeploymentRepository>${altSnapshotDeploymentRepository}</altSnapshotDeploymentRepository>
          <artifact default-value="${project.artifact}"/>
          <attachedArtifacts default-value="${project.attachedArtifacts}"/>
          <deployAtEnd default-value="false">true</deployAtEnd>
          <localRepository default-value="${localRepository}"/>
          <offline default-value="${settings.offline}"/>
          <packaging default-value="${project.packaging}"/>
          <pomFile default-value="${project.file}"/>
          <project default-value="${project}"/>
          <reactorProjects default-value="${reactorProjects}"/>
          <retryFailedDeploymentCount default-value="1">${retryFailedDeploymentCount}</retryFailedDeploymentCount>
          <skip default-value="false">true</skip>
          <updateReleaseInfo default-value="false">${updateReleaseInfo}</updateReleaseInfo>
        </configuration>
        [DEBUG] ============================
        

        Added an IT which prooves the existence of the problem.
        Added in r1620139.

        Show
        Karl Heinz Marbaise added a comment - I have checked the output via a test case which produces this: [DEBUG] ----------------------------------------------------------------------- [DEBUG] Goal: org.apache.maven.plugins:maven-deploy-plugin:2.9-SNAPSHOT:deploy (default-deploy) [DEBUG] Style: Regular [DEBUG] Configuration: <?xml version= "1.0" encoding= "UTF-8" ?> <configuration> <altDeploymentRepository> ${altDeploymentRepository} </altDeploymentRepository> <altReleaseDeploymentRepository> ${altReleaseDeploymentRepository} </altReleaseDeploymentRepository> <altSnapshotDeploymentRepository> ${altSnapshotDeploymentRepository} </altSnapshotDeploymentRepository> <artifact default-value= "${project.artifact}" /> <attachedArtifacts default-value= "${project.attachedArtifacts}" /> <deployAtEnd default-value= "false" > true </deployAtEnd> <localRepository default-value= "${localRepository}" /> <offline default-value= "${settings.offline}" /> <packaging default-value= "${project.packaging}" /> <pomFile default-value= "${project.file}" /> <project default-value= "${project}" /> <reactorProjects default-value= "${reactorProjects}" /> <retryFailedDeploymentCount default-value= "1" > ${retryFailedDeploymentCount} </retryFailedDeploymentCount> <skip default-value= "false" > true </skip> <updateReleaseInfo default-value= "false" > ${updateReleaseInfo} </updateReleaseInfo> </configuration> [DEBUG] ============================ Added an IT which prooves the existence of the problem. Added in r1620139 .
        Hide
        Karl Heinz Marbaise added a comment -

        A simple work a round at the moment is to define a property within your pom file:

         <properties>
           <deployAtEnd>true<deployAtEnd>
         </properties>
         ...
         <deployAtEnd>${deployAtEnd}</deployAtEnd>
        

        This should work to override this via command line:

        mvn clean deploy -DdeployAtEnd=false
        
        Show
        Karl Heinz Marbaise added a comment - A simple work a round at the moment is to define a property within your pom file: <properties> <deployAtEnd> true <deployAtEnd> </properties> ... <deployAtEnd> ${deployAtEnd} </deployAtEnd> This should work to override this via command line: mvn clean deploy -DdeployAtEnd= false
        Hide
        Robert Scholte added a comment -

        This is how configuration of a Maven plugin works. And actually: I like it. This makes build much more predictable. If you really want the ability to override it, then use properties.

        Show
        Robert Scholte added a comment - This is how configuration of a Maven plugin works. And actually: I like it. This makes build much more predictable. If you really want the ability to override it, then use properties.
        Hide
        Guillaume Boué added a comment -

        Since this is issue closed as "Not A Problem", should we remove the test added in r1620139 or make the failure expected? The test fails in CI at the moment.

        It is indeed expected: the parameters configured in the POM take precedence over those from the default configuration (this can be seen in Maven Core inside the class DefaultLifecycleExecutionPlanCalculator).

        Show
        Guillaume Boué added a comment - Since this is issue closed as "Not A Problem", should we remove the test added in r1620139 or make the failure expected? The test fails in CI at the moment. It is indeed expected: the parameters configured in the POM take precedence over those from the default configuration (this can be seen in Maven Core inside the class DefaultLifecycleExecutionPlanCalculator ).
        Hide
        Robert Scholte added a comment -

        It is probably better to remove it, it is not a specific test for the maven-deploy-plugin. Go ahead.

        Show
        Robert Scholte added a comment - It is probably better to remove it, it is not a specific test for the maven-deploy-plugin. Go ahead.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in maven-plugins #7086 (See https://builds.apache.org/job/maven-plugins/7086/)
        MDEPLOY-181 DeployAtEnd cannot be overwritten from command line using -DdeployAtEnd=false

        This issue is closed as "Not A Problem", removing the IT introduced in r1620139. It is expected for the parameters configured in the POM to have precedence over the ones from the default configuration. (gboue: http://svn.apache.org/viewvc/?view=rev&rev=1755406)

        Show
        Hudson added a comment - SUCCESS: Integrated in maven-plugins #7086 (See https://builds.apache.org/job/maven-plugins/7086/ ) MDEPLOY-181 DeployAtEnd cannot be overwritten from command line using -DdeployAtEnd=false This issue is closed as "Not A Problem", removing the IT introduced in r1620139. It is expected for the parameters configured in the POM to have precedence over the ones from the default configuration. (gboue: http://svn.apache.org/viewvc/?view=rev&rev=1755406 ) maven-deploy-plugin/src/it/ MDEPLOY-181

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Christian Lipphardt (camunda)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development