Uploaded image for project: 'Maven Release Plugin'
  1. Maven Release Plugin
  2. MRELEASE-515

release:prepare eats the root cause of the exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-9
    • 2.0
    • None
    • None
    • Patch

    Description

      The PrepareReleaseMojo.execute() method contains the following statement:

      try
      {
          releaseManager.prepare( config, getReleaseEnvironment(), reactorProjects, resume, dryRun );
      }
      catch ( ReleaseExecutionException e )
      {
          throw new MojoExecutionException( e.getMessage(), e );
      }
      catch ( ReleaseFailureException e )
      {
          throw new MojoFailureException( e.getMessage() );
      }
      

      As you can see, the stack trace and nested exception of the ReleaseFailureException is lost, which makes it unnecessarily hard to diagnose the root cause of problems like MRELEASE-332. The code should be modified to something like:

      throw (MojoFailureException)new MojoFailureException( e.getMessage() ).initCause(e);
      

      Attachments

        Activity

          People

            brett Brett Porter
            kohsuke Kohsuke Kawaguchi
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: