Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-101

Plugin not longer sets system properties when forking is on and debugging information is not correct

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 2.0 (2.2 plugin)
    • None
    • None
    • None

    Description

      The following code is in SurefirePlugin.java:

              processSystemProperties( !fork.isForking() );
      
              if ( getLog().isDebugEnabled() )
              {
                  showMap( systemProperties, "system property" );
              }
      

      2 problems:

      1) fork.isForking() is false when forking is enabled and thus system properties are not set:

          protected void processSystemProperties( boolean setInSystem )
          {
      [...]
              if ( setInSystem )
              {
                  // Add all system properties configured by the user
                  Iterator iter = systemProperties.keySet().iterator();
      
                  while ( iter.hasNext() )
                  {
                      String key = (String) iter.next();
      
                      String value = systemProperties.getProperty( key );
      
                      System.setProperty( key, value );
                  }
              }
          }
      

      2) showMap() is called regardless of whether the system properties are set or not, leading to the following kind of misleading logs:

      [...]
      [DEBUG] Setting system property [cargo.jetty4x.port]=[8280]
      [DEBUG] Setting system property [cargo.jetty6x.port]=[8280]
      [DEBUG] Setting system property [cargo.jetty5x.port]=[8280]
      [...]
      

      Those properties are actually NOT set.

      Attachments

        1. MSUREFIRE-145.zip
          4 kB
          Vincent Massol

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: