Maven
  1. Maven
  2. MNG-3810

[regression] Null Pointer Exception when Activation Profile Property is Empty

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.10, 2.1.0-M1, 3.0-alpha-1
    • Fix Version/s: 2.0.11, 2.1.0
    • Component/s: Profiles
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      The following will generate a null pointer exception when it is in the project POM. (or potentially any pom, I don't know)
      ...

      <profiles>
        <profile>
          <id>localdev</id>
          <activation>
            <os>
              <name>Windows XP</name>
            </os>
            <property>
            </property>
          </activation>
          <build>
      ...
      
      Exception in thread "main" java.lang.NullPointerException
      	at org.apache.maven.profiles.activation.SystemPropertyProfileActivator.isActive(SystemPropertyProfileActivator.java:49)
      	at org.apache.maven.profiles.DefaultProfileManager.isActive(DefaultProfileManager.java:296)
      	at org.apache.maven.profiles.DefaultProfileManager.getActiveProfiles(DefaultProfileManager.java:222)
      	at org.apache.maven.profiles.build.DefaultProfileAdvisor.getArtifactRepositoriesFromActiveProfiles(DefaultProfileAdvisor.java:182)
      	at org.apache.maven.profiles.build.DefaultProfileAdvisor.getArtifactRepositoriesFromActiveProfiles(DefaultProfileAdvisor.java:233)
      	at org.apache.maven.project.build.model.DefaultModelLineageBuilder.loadActiveProfileRepositories(DefaultModelLineageBuilder.java:306)
      	at org.apache.maven.project.build.model.DefaultModelLineageBuilder.updateRepositorySet(DefaultModelLineageBuilder.java:256)
      	at org.apache.maven.project.build.model.DefaultModelLineageBuilder.buildModelLineage(DefaultModelLineageBuilder.java:125)
      	at org.apache.maven.extension.DefaultBuildExtensionScanner.buildModelLineage(DefaultBuildExtensionScanner.java:425)
      	at org.apache.maven.extension.DefaultBuildExtensionScanner.scanInternal(DefaultBuildExtensionScanner.java:137)
      	at org.apache.maven.extension.DefaultBuildExtensionScanner.scanForBuildExtensions(DefaultBuildExtensionScanner.java:107)
      	at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:275)
      	at org.apache.maven.DefaultMaven.createReactorManager(DefaultMaven.java:103)
      	at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:160)
      	at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
      	at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
      	at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
      	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:52)
      

        Activity

        Hide
        Brett Porter added a comment -

        this was introduced in 2.0.10. Not marking as a release blocker however since it is invalid syntax anyway

        Show
        Brett Porter added a comment - this was introduced in 2.0.10. Not marking as a release blocker however since it is invalid syntax anyway
        Hide
        Brett Porter added a comment -

        applied

        Show
        Brett Porter added a comment - applied

          People

          • Assignee:
            Brett Porter
            Reporter:
            Chris Pall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: