Maven Changes Plugin
  1. Maven Changes Plugin
  2. MCHANGES-278

Improved logging and exception messages to aid troubleshooting

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.9
    • Component/s: announcement
    • Labels:
      None
    • Environment:
    • Flags:
      Patch

      Description

      Aid the user in troubleshooting configuration issues by improving logging and exception messages such as the "Couldn't find the release 'XYZ' among the supplied releases." MojoExecutionException.

      1. Add String representation of found releases to Exception in method org.apache.maven.plugin.changes.ReleaseUtils.getLatestRelease(List<Release>, String)
            throw new MojoExecutionException( "Could not find release [" + pomVersion
                  + "] among the supplied releases: " + toString(releases) );
        
            // ... snip ...
        
            public String toString(List<Release> _releases) {
                List<String> releaseStrs = new ArrayList<String>(_releases.size());
                for (Release release : _releases) {
                    releaseStrs.add(toString(release));
                }
                return releaseStrs.toString();
            }
        
            public String toString(Release _release) {
                return _release.getClass().getSimpleName()
                        + "[version='" + _release.getVersion() + "'"
                        + ", date='" + StringUtils.defaultString(_release.getDateRelease()) + "'"
                        + ", description='" + StringUtils.defaultString(_release.getDescription()) + "'"
                        + ", totalActions=" + _release.getActions().size()
                        + "]";
            }
        
      1. Add debug log to announcement generation:
            public void doGenerate( List<Release> releases ) throws MojoExecutionException
            {
                String version = ( versionPrefix == null ? "" : versionPrefix ) + getVersion();
        
                getLog().debug( "Generating accouncement for version [" + version + "], found releases: " + releaseUtils.toString(releases) );
                doGenerate( releases, releaseUtils.getLatestRelease( releases, version ) );
            }
        

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Dennis Lundberg
            Reporter:
            Markus Spann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development