Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5863

default pom's release-profile should invoke source plugin with goal "jar-no-fork" instead of "jar"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.3.3
    • None
    • POM
    • None

    Description

      in maven-model-builder, the file pom-4.0.0.xml defines "release-profile" which binds some executions to the lifecycle.
      One of them is source:jar - which forks the build. That can be a problem in some configurations, and the forking is probably not necessary.

      One situation where the forked build hurts is this:

      • I have checkstyle:check attached to phase "validate"
      • some of my modules generate code, obviously not compliant to the checkstyle

      The problem is that, inside forked build, the checkstyle:check is called again, but now it checks also the generated code (because target/ is no longer empty). And of course fails.

      Even worse: during normal development iterations, everything is fine. But when I have to issue a release (usually under some pressure), I hit this problem.

      Fortunately, there is a workaround: override the execution "attach-sources" and assign it to a non-existing phase, and define execution with different id for that.
      But it is too ugly and I believe that the simple fix would solve it - for the meantime before the whole profile is removed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pkozelka Petr Kozelka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.25h
                  0.25h
                  Remaining:
                  Remaining Estimate - 0.25h
                  0.25h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified