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

Exception when printing Reactor Summary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.2.2
    • Logging
    • None

    Description

      We get the following exception in maven 3.2.1:

      17:14:29,313 INFO  - org.emftext.commons.antlr3_4_0 .................... SUCCESS [ 13.624 s]
      17:14:29,313 INFO  - acceleo-maven ..................................... SUCCESS [ 0.811 s]
      17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec ................... SUCCESS [ 6.208 s]
      17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.resource.dfspec ... SUCCESS [ 9.181 s]
      17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.generator ......... SUCCESS [ 27.518 s]
      17:14:29,313 INFO  - df7-java-generator ................................ SUCCESS [ 12.459 s]
      17:14:29,313 INFO  - df7-cpp-generator ................................. SUCCESS [ 16.046 s]
      17:14:29,313 INFO  - df7-wiki-generator ................................ SUCCESS [ 8.318 s]
      17:14:29,313 INFO  - dfutils ........................................... SUCCESS [ 17.114 s]
      17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.resource.dfspec.ui SUCCESS [ 7.206 s]
      17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.validation ........ SUCCESS [ 10.988 s]
      17:14:29,313 INFO  - df7-cpp-testgenerator ............................. SUCCESS [01:11 min]
      17:14:29,313 INFO  - df7-java-testgenerator ............................ SUCCESS [01:10 min]
      17:14:29,313 INFO  - df7-wiki-testgenerator ............................ SUCCESS [ 10.267 s]
      17:14:29,324 ERROR - Internal error: java.lang.NegativeArraySizeException -> [Help 1]
      17:14:29,327 ERROR - org.apache.maven.InternalErrorException: Internal error: java.lang.NegativeArraySizeException
      17:14:29,327 ERROR -     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
      17:14:29,327 ERROR -     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
      17:14:29,327 ERROR -     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
      17:14:29,327 ERROR -     at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
      17:14:29,327 ERROR -     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:14:29,327 ERROR -     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      17:14:29,327 ERROR -     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      17:14:29,327 ERROR -     at java.lang.reflect.Method.invoke(Method.java:606)
      17:14:29,327 ERROR -     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      17:14:29,327 ERROR -     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      17:14:29,327 ERROR -     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      17:14:29,327 ERROR -     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      17:14:29,327 ERROR - Caused by: java.lang.NegativeArraySizeException
      17:14:29,328 ERROR -     at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:64)
      17:14:29,328 ERROR -     at java.lang.StringBuilder.<init>(StringBuilder.java:97)
      17:14:29,328 ERROR -     at org.apache.maven.cli.event.ExecutionEventLogger.chars(ExecutionEventLogger.java:67)
      17:14:29,328 ERROR -     at org.apache.maven.cli.event.ExecutionEventLogger.logReactorSummary(ExecutionEventLogger.java:155)
      17:14:29,328 ERROR -     at org.apache.maven.cli.event.ExecutionEventLogger.sessionEnded(ExecutionEventLogger.java:111)
      17:14:29,328 ERROR -     at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:64)
      17:14:29,328 ERROR -     at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
      17:14:29,329 ERROR -     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:125)
      17:14:29,329 ERROR -     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
      17:14:29,329 ERROR -     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
      17:14:29,329 ERROR -     ... 11 more
      17:14:29,329 ERROR - 
      

      It occurs not every build, but maybe every second or third.
      I downloaded the source tar.gz and found that indeed in line 155 of ExecutionEventLogger.java we have

      154:                String buildTimeDuration = formatDuration( buildSummary.getTime() ); 
      155:                buffer.append( chars( ' ', BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length() ) );
      

      where

      47:    private static final int BUILD_TIME_DURATION_LENGTH = 9;
      

      However, in formatDuration, from CLIReportingUtils.java , it seems that the generated strings can well exceed this length:

      177:            format = "%d d %02d:%02d h";
      

      This has, as far as I understand, at least 6 characters, if we add two for minutes and minimum one for hour and one for day, this will already exceed the BUILD_TIME:DURATION_LENGTH. This seems an obvious bug to me.

      However our build times are usually less than one hour, so there must be some other reason for our strange long build time duration string.
      If the bug above was fixed, we could see better what's going on.

      Attachments

        1. MNG-5626.patch
          3 kB
          Michael Osipov

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              christian.jung Christian Jung
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: