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

multi module release fails because of test-jar

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      maven 2.0.5
    • Number of attachments :
      0

      Description

      The release plugin is failing in the prepare task

      mvn release:prepare

      seemingly because it can't find the test-jar that has just been built by the previous module i.e. built within.

      Are there some examples in the wild of using the test-jar on a multi module project that does releases?

      The (nasty) workaround I have for now, is to wait for the build to fail and then

      mvn install

      So the test-jar (and other artifacts) are in my local repository and then continue

      mvn release:prepare

        Issue Links

          Activity

          Hide
          Chad Lyon added a comment -

          right, but do you agree that in a multi-module project if you are skipping tests (which includes skipping the build of the test JAR) then your modules that rely on that test JAR to run their tests won't need the test JAR and therefore should not fail with a "Missing dependency" (namely that test JAR)?

          The reason they should not fail is because they aren't running tests!!! I'm saying that the problem here is that in a sub-module POM if I specify:

          <scope>test</scope>

          for a dependency and then I skip tests then that dep should not even be checked for.

          Show
          Chad Lyon added a comment - right, but do you agree that in a multi-module project if you are skipping tests (which includes skipping the build of the test JAR) then your modules that rely on that test JAR to run their tests won't need the test JAR and therefore should not fail with a "Missing dependency" (namely that test JAR)? The reason they should not fail is because they aren't running tests!!! I'm saying that the problem here is that in a sub-module POM if I specify: <scope>test</scope> for a dependency and then I skip tests then that dep should not even be checked for.
          Hide
          Michael added a comment -

          I agree with Chad. We just ran into this problem. Any update? For now we're using maven.skip.exec=true.

          Show
          Michael added a comment - I agree with Chad. We just ran into this problem. Any update? For now we're using maven.skip.exec=true.
          Hide
          werner mueller added a comment -

          as mentioned above you can do a release with different preparation goals:

          $ mvn release:prepare -DpreparationGoals="clean install"
          $ mvn release:perform

          this is still a workaround but well it works (creating the test-jar and execute tests in depending modules)

          Show
          werner mueller added a comment - as mentioned above you can do a release with different preparation goals: $ mvn release:prepare -DpreparationGoals="clean install" $ mvn release:perform this is still a workaround but well it works (creating the test-jar and execute tests in depending modules)
          Hide
          Dennis Lundberg added a comment -

          We set <type>test-jar</type> on a dependency on a test jar.

          Show
          Dennis Lundberg added a comment - We set <type>test-jar</type> on a dependency on a test jar.
          Hide
          Archimedes Trajano added a comment - - edited

          This works well on 3.0.3

          Show
          Archimedes Trajano added a comment - - edited This works well on 3.0.3

            People

            • Assignee:
              Unassigned
              Reporter:
              Yuri Schimke
            • Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated: