Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.6
-
None
-
mvn --version :
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /opt/local/apache-maven-3.0.4
Java version: 1.6.0_20, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-40-generic", arch: "i386", family: "unix"mvn --version : Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) Maven home: /opt/local/apache-maven-3.0.4 Java version: 1.6.0_20, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-openjdk/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-40-generic", arch: "i386", family: "unix"
-
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.
- 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() + "]"; }
- 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 ) ); }