Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-503

requireOS cause NPE with Maven 3.9.7

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 3.5.0
    • requireOS
    • None

    Description

      In rule requireOS we use: org.apache.maven.model.profile.activation.ProfileActivator#isActive

      as

      activator.isActive(createProfile(), null, null); 
      

      so provided context is null ... but not Maven use context without protecting it

       

      From docs:

      /**
       * Determines whether the specified profile is active in the given activator context.
       *
       * @param profile The profile whose activation status should be determined, must not be {@code null}.
       * @param context The environmental context used to determine the activation status of the profile, must not be
       *            {@code null}.
       * @param problems The container used to collect problems (e.g. bad syntax) that were encountered, must not be
       *            {@code null}.
       * @return {@code true} if the profile is active, {@code false} otherwise.
       */
      boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems ); 

       

      So enforcer use it in wrong way.

      Attachments

        Issue Links

          Activity

            People

              sjaranowski Slawomir Jaranowski
              sjaranowski Slawomir Jaranowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: