Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6053

Unsafe System Properties copy in MavenRepositorySystemUtils, causing NPEs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.9
    • 3.5.0-alpha-1, 3.5.0
    • None
    • None
    • Eclipse m2e 1.7

    Description

      This bug has been reported in m2e https://bugs.eclipse.org/bugs/show_bug.cgi?id=493871:

      I'm occasionally, not 100% reliably reproducible, but regularly enough (like it occurs every now and then, not just once) seeing the error below, in the Error Log of Eclipse during workspace rebuilds. This is with M2E 1.7.0. – I'm not sure if this is just "annoying" or actually prevents M2E from correctly configuring projects . Either way, perhaps it would be possible to "harden" respective code to prevent this?

      java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:459)
      at org.apache.maven.repository.internal.MavenRepositorySystemUtils.newSession(MavenRepositorySystemUtils.java:133)
      at org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory.newRepositorySession(DefaultRepositorySystemSessionFactory.java:98)
      at org.apache.maven.DefaultMaven.newRepositorySession(DefaultMaven.java:352)
      at org.eclipse.m2e.core.internal.embedder.MavenImpl.createRepositorySession(MavenImpl.java:309)

      Looking at https://github.com/apache/maven/blob/86b656167923923e2e416def4a48303b4e6248fa/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java#L132, it seems some system property is null (maybe due to some concurrency issue), and given that Hashtable doesn't support null values, then it throws an NPE on the put() call

      Attachments

        Issue Links

          Activity

            People

              gboue Guillaume Boué
              fbricon Fred Bricon
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: