Maven 2.x Enforcer Plugin

enforce-once causes MNG-2277 to be expressed in reactor builds. Find a way to work around it.

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-alpha-3
  • Fix Version/s: 1.0-alpha-4
  • Component/s: Plugin
  • Labels:
    None
  • Number of attachments :
    0

Description

In 1.0-alpha-3, the enforce goal now requires dependency resolution to support the new dependency rules (noSnapshots, noBannedDependencies). Because enforce-once extends and adds as an aggregator, this causes the maven bug MNG-2277 to appear. The work around for now is to use enforce not the enforce-once goal (the aggregator part of enforce-once doesn't work anyway).

The fix would be to resolve the dependencies manually in the plugin or to make a new mojo that requires dependency resolution and put enforce and enforce-once back the way they where.

Issue Links

Activity

Hide
Andrew Perepelytsya added a comment -

This is not really a workaround. We have around 90 modules now and using enforce instead of enforce-once simply kills the build making it unusable.

Show
Andrew Perepelytsya added a comment - This is not really a workaround. We have around 90 modules now and using enforce instead of enforce-once simply kills the build making it unusable.
Hide
Brian Fox added a comment -

I don't see how it's any different. The enforce-once goal still doesn't work correctly and executes again for every project anyway. (MENFORCER-12)

Show
Brian Fox added a comment - I don't see how it's any different. The enforce-once goal still doesn't work correctly and executes again for every project anyway. (MENFORCER-12)
Hide
Damien Lecan added a comment -

Multi-module project build doesn't work anymore with alpha-3 for my projects (between 10 and 40 modules)
alpha-2 is working fine

Show
Damien Lecan added a comment - Multi-module project build doesn't work anymore with alpha-3 for my projects (between 10 and 40 modules) alpha-2 is working fine
Hide
Brian Fox added a comment -

Enforce-once has the @aggregator removed and is now deprecated.

Unfortunately, in Maven, the @aggregator only applies to command line invocation and has no real effect when bound to a pom (at least not the run once desired effect).

In the future, I may add caching to the rules to allow things to run once, but the plugin will still execute for all children. A rule will need to declare if it is safe to cache or not.

Show
Brian Fox added a comment - Enforce-once has the @aggregator removed and is now deprecated. Unfortunately, in Maven, the @aggregator only applies to command line invocation and has no real effect when bound to a pom (at least not the run once desired effect). In the future, I may add caching to the rules to allow things to run once, but the plugin will still execute for all children. A rule will need to declare if it is safe to cache or not.
Hide
Jorg Heymans added a comment -

I just spent a good few hours tracking down the weirdest build errors in our project due to this bug. When is the next release scheduled for ?

Show
Jorg Heymans added a comment - I just spent a good few hours tracking down the weirdest build errors in our project due to this bug. When is the next release scheduled for ?
Hide
Brian Fox added a comment -

It should go out for vote in a few days. You can try the RC at http://people.apache.org/~brianf/2.0.8

Show
Brian Fox added a comment - It should go out for vote in a few days. You can try the RC at http://people.apache.org/~brianf/2.0.8
Hide
Brian Fox added a comment -

I got the issues confused, the enforcer plugin should be out very shortly as well.

Show
Brian Fox added a comment - I got the issues confused, the enforcer plugin should be out very shortly as well.

People

Vote (12)
Watch (12)

Dates

  • Created:
    Updated:
    Resolved: