• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Platform: All, OS: All

      I have the following maven2 project hierarchy:

      -> A <-
       
       

      B <------ C

      So there is no circular dependency. This works nicely unless, C is a module of
      A, i.e.:
      a/pom.xml
      a/c/pom.xml
      b/pom.xml

      and A lists C as module.

      In Hudson, project A has B listed as both upstream and downstrean dependency,
      which results in an infinite build loop. However, I think this is a legal setup
      in Maven2, as there is no circular dependency. I haven't investigated this
      thoroughly, but it might be that modules are considered downstream projects even
      they aren't.

      I'll attach a test project demonstrating the bug. Just adding A and B to Hudson
      should cause the loop. If not, committing something should do it.

          [JENKINS-1722] Detect a cycle in Maven project and report it

          syvalta added a comment -

          Created an attachment (id=261)
          Example project demonstrating the bug

          syvalta added a comment - Created an attachment (id=261) Example project demonstrating the bug

          There is indeed a cycle in your build, not at a module level, but at a reactor
          level.

          You organized your build into two Maven reactor executions, one that just builds
          B and the other that builds A and C. B depends on A+C since B depends on A, and
          A+C depends on B because C depends on B.

          While Maven doesn't detect this as an error, this is nontheless a problematic
          dependency set up. Imagine, for example, running maven release plugin on these
          modules, and I hope you'll see why this is not a Hudson problem.

          In the mean time, there's an RFE filed as #1714 which should help you with this
          situation. The remaining issue is for Hudson to be able to diagnose the cycle
          problem, so I'm updating this issue accordingly.

          Kohsuke Kawaguchi added a comment - There is indeed a cycle in your build, not at a module level, but at a reactor level. You organized your build into two Maven reactor executions, one that just builds B and the other that builds A and C. B depends on A+C since B depends on A, and A+C depends on B because C depends on B. While Maven doesn't detect this as an error, this is nontheless a problematic dependency set up. Imagine, for example, running maven release plugin on these modules, and I hope you'll see why this is not a Hudson problem. In the mean time, there's an RFE filed as #1714 which should help you with this situation. The remaining issue is for Hudson to be able to diagnose the cycle problem, so I'm updating this issue accordingly.

          kutzi added a comment -

          Still happening in Jenkins 1.412: the 2 projects are build in a never ending loop.
          But since Jenkins is handling this IMO 'as designed' I would reduce the priority to Major

          kutzi added a comment - Still happening in Jenkins 1.412: the 2 projects are build in a never ending loop. But since Jenkins is handling this IMO 'as designed' I would reduce the priority to Major

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

              Created:
              Updated: