Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] [MASSEMBLY-925] Detailed error message on assembly failure #22

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,16 @@ public void finalizeArchiveCreation( final Archiver archiver )
// runArchiveFinalizers() is called before regular resources are added...
// which is done because the manifest needs to be added first, and the
// manifest-creation component is a finalizer in the assembly plugin...
for ( final ResourceIterator it = archiver.getResources(); it.hasNext(); )
try
{
for ( final ResourceIterator it = archiver.getResources(); it.hasNext(); )
{
it.next();
}
}
catch ( ArchiverException e )
{
it.next();
throw new ArchiverException( "Failed on finalizing archive creation " + e.getMessage() );
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,10 @@ public void execute() throws MojoExecutionException, MojoFailureException
boolean warnedAboutMainProjectArtifact = false;
for ( final Assembly assembly : assemblies )
{
String fullName = "";
try
{
final String fullName = AssemblyFormatUtils.getDistributionName( assembly, this );
fullName = AssemblyFormatUtils.getDistributionName( assembly, this );

List<String> effectiveFormats = formats;
if ( effectiveFormats == null || effectiveFormats.size() == 0 )
Expand All @@ -515,12 +516,12 @@ public void execute() throws MojoExecutionException, MojoFailureException
throw new MojoFailureException(
"No formats specified in the execution parameters or the assembly descriptor." );
}

System.out.println( "519" );
for ( final String format : effectiveFormats )
{
final File destFile = assemblyArchiver.createArchive( assembly, fullName, format, this,
isRecompressZippedFiles(), getMergeManifestMode(), outputDate );

System.out.println( "524" );
final MavenProject project = getProject();
final String type = project.getArtifact().getType();

Expand Down Expand Up @@ -574,7 +575,8 @@ else if ( attach )
}
catch ( final ArchiveCreationException | AssemblyFormattingException e )
{
throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage()
+ " Full name is: " + fullName, e );
}
catch ( final InvalidAssemblerConfigurationException e )
{
Expand Down