Maven JAR Plugin
  1. Maven JAR Plugin
  2. MJAR-90

when maven.test.Skip is set, the test-jar artifact is empty

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      running any project with test-jar mojo

      Description

      as maven.test.skip disable test compilation, the generated test-jar is empty.

        Issue Links

          Activity

          nicolas de loof created issue -
          Hide
          Wendy Smoak added a comment -

          What behavior do you expect to see? Should the test jar not get generated at all in this situation?

          Show
          Wendy Smoak added a comment - What behavior do you expect to see? Should the test jar not get generated at all in this situation?
          nicolas de loof made changes -
          Field Original Value New Value
          Assignee nicolas de loof [ ndeloof ]
          Hide
          nicolas de loof added a comment -

          Fixed at revision: 604458

          Show
          nicolas de loof added a comment - Fixed at revision: 604458
          nicolas de loof made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 2.2 [ 12878 ]
          Resolution Fixed [ 1 ]
          Hide
          Chad Lyon added a comment -

          This fix causes problems for multi-module projects. See MJAR-68

          Show
          Chad Lyon added a comment - This fix causes problems for multi-module projects. See MJAR-68
          Hide
          nicolas de loof added a comment -

          See comment on MJAR-68.

          There is no way (AFAIK) to avoid test-scope dependency resolution based on -Dmaven.test.skip=true.
          You should use -Dmaven.test.skip.exec=true to compile and package test, but not run them.

          Show
          nicolas de loof added a comment - See comment on MJAR-68 . There is no way (AFAIK) to avoid test-scope dependency resolution based on -Dmaven.test.skip=true. You should use -Dmaven.test.skip.exec=true to compile and package test, but not run them.
          Hide
          Chad Lyon added a comment -

          Then I think creating a blank JAR is a good thing. It will cause the dependency resolution to not fail when tests are skipped. Perhaps this fix should be rolled back.

          Show
          Chad Lyon added a comment - Then I think creating a blank JAR is a good thing. It will cause the dependency resolution to not fail when tests are skipped. Perhaps this fix should be rolled back.
          Hide
          nicolas de loof added a comment -

          A blank jar is never a good think. You will have a jar in your repo that is NOT what it is expected to be, and can introduce strange issues when you come back to your IDE. It also adds the risk to deploy an empty jar if your release goal includes "deploy".

          If you don't want to execute tests as part of the release process (I also do) simply set <arguments>-Dmaven.test.skip.exec</arguments> in your POM for the release plugin, or maybe in a parent corporate POM.

          Show
          nicolas de loof added a comment - A blank jar is never a good think. You will have a jar in your repo that is NOT what it is expected to be, and can introduce strange issues when you come back to your IDE. It also adds the risk to deploy an empty jar if your release goal includes "deploy". If you don't want to execute tests as part of the release process (I also do) simply set <arguments>-Dmaven.test.skip.exec</arguments> in your POM for the release plugin, or maybe in a parent corporate POM.
          Hide
          Asaf Mesika added a comment -

          maven.test.skip.exec is deprecated I think.

          You should use -DskipTests.
          Does the same thing, but shorter.

          Show
          Asaf Mesika added a comment - maven.test.skip.exec is deprecated I think. You should use -DskipTests. Does the same thing, but shorter.
          Benjamin Bentmann made changes -
          Link This issue relates to MJAR-138 [ MJAR-138 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MJAR-68 [ MJAR-68 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 10:31:03 UTC 2015 [ 1428229863560 ]
          Mark Thomas made changes -
          Workflow jira [ 12721981 ] Default workflow, editable Closed status [ 12759544 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 00:05:23 UTC 2015 [ 1428278723217 ]
          Mark Thomas made changes -
          Workflow jira [ 12959521 ] Default workflow, editable Closed status [ 12996297 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          33m 50s 1 nicolas de loof 15/Dec/07 11:27

            People

            • Assignee:
              nicolas de loof
              Reporter:
              nicolas de loof
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development