Uploaded image for project: 'Maven Changes Plugin'
  1. Maven Changes Plugin
  2. MCHANGES-278

Improved logging and exception messages to aid troubleshooting

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6
    • 2.9
    • announcement
    • None
    • 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 ) );
            }
        

      Attachments

        Activity

          People

            dennisl@apache.org Dennis Lundberg
            spannjp Markus Spann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: