Maven Enforcer Plugin
  1. Maven Enforcer Plugin
  2. MENFORCER-89

Plugin doesn't validate my current build, but the latest SNAPSHOT in the repository!

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.0-beta-1
    • Fix Version/s: None
    • Component/s: Plugin
    • Labels:
      None
    • Number of attachments :
      1

      Description

      I've added the enforcer-plugin to my build today, but now my projects don't build anymore! The reason for that is that the enforcer-plugin is reporting missing versions (<requirePluginVersions />), although the versions are actually set!

      I've been checking what might be wrong and noticed that as soon as the plugin executes, it checks for updates for the project that is currently being built! In that case, the plugin is actually right, because the latest deployed snapshots have some unversioned plugins. However, shouldn't the plugin validate the project currently in the reactor?

        Issue Links

          Activity

          Hide
          Dan Tran added a comment -

          you may want to submit a producible pom, otherwise, this issue may may never get looked at

          Show
          Dan Tran added a comment - you may want to submit a producible pom, otherwise, this issue may may never get looked at
          Hide
          Roland Asmann added a comment -

          I'll rewrite one of my POMs for that... Although I think this problem occurs on any POM...

          Show
          Roland Asmann added a comment - I'll rewrite one of my POMs for that... Although I think this problem occurs on any POM...
          Hide
          Roland Asmann added a comment -

          Okay, so I've been trying to create a simple little project to submit here, but I can't reproduce it in a simple project. I'll keep on trying though.

          I did however check all my other projects (running nightly builds in Hudson, so that's easy enough) and there I noticed this problem occurs only on 2 of my projects. I have no clue as to why, since at least 5 of them are similar in structure and had missing versions in their previous iteration... Funny thing is that in those other projects, the enforcer-plugin (or maven itself, I'm still not sure which) doesn't even lookup the latest snapshot from the repository. Like I said, it only does that in 2 projects and both of those then fail.

          For my builds, I can surely create a simple workaround (deploy a version without the enforcer, but with the versions for plugins set) and then go on from there, but I think this is a bug that definitely needs fixing!

          So, that where I'm at at this point. As soon as I have a reproducible little project, I'll attach it!

          Show
          Roland Asmann added a comment - Okay, so I've been trying to create a simple little project to submit here, but I can't reproduce it in a simple project. I'll keep on trying though. I did however check all my other projects (running nightly builds in Hudson, so that's easy enough) and there I noticed this problem occurs only on 2 of my projects. I have no clue as to why, since at least 5 of them are similar in structure and had missing versions in their previous iteration... Funny thing is that in those other projects, the enforcer-plugin (or maven itself, I'm still not sure which) doesn't even lookup the latest snapshot from the repository. Like I said, it only does that in 2 projects and both of those then fail. For my builds, I can surely create a simple workaround (deploy a version without the enforcer, but with the versions for plugins set) and then go on from there, but I think this is a bug that definitely needs fixing! So, that where I'm at at this point. As soon as I have a reproducible little project, I'll attach it!
          Hide
          Roland Asmann added a comment -

          I finally was able to reproduce the problem!

          If a project has a groupId that consists of variables (eg "$

          {parent.groupId}

          .$

          {parent.artifactId}

          "), running the enforcer-plugin triggers a download of the POM, which might not exist in the remote repository!

          Running the project without the enforcer works like it should.

          In the ZIP is a small project to reproduce the bug. In case you tested it WITHOUT the enforcer and have run 'mvn install', you won't be able to reproduce the bug again unless you delete the project from your local repository first!

          Show
          Roland Asmann added a comment - I finally was able to reproduce the problem! If a project has a groupId that consists of variables (eg "$ {parent.groupId} .$ {parent.artifactId} "), running the enforcer-plugin triggers a download of the POM, which might not exist in the remote repository! Running the project without the enforcer works like it should. In the ZIP is a small project to reproduce the bug. In case you tested it WITHOUT the enforcer and have run 'mvn install', you won't be able to reproduce the bug again unless you delete the project from your local repository first!
          Hide
          Robert Scholte added a comment -

          Although the title of this issue is misleading, the actual cause are expressions in the GAV of the plugins. This has been fixed with MENFORCER-126

          Show
          Robert Scholte added a comment - Although the title of this issue is misleading, the actual cause are expressions in the GAV of the plugins. This has been fixed with MENFORCER-126

            People

            • Assignee:
              Robert Scholte
              Reporter:
              Roland Asmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: