throw new ArchiveCreationException( "Artifact: " + artifact.getId()
+ " (included by module) does not have an artifact with a file. "
+ "Please ensure the package phase is run before the assembly is generated." );
}
final AddArtifactTask task = new AddArtifactTask( artifact, getLogger() );
task.setFileNameMapping( binaries.getOutputFileNameMapping() );
task.setOutputDirectory( binaries.getOutputDirectory() );
task.setProject( project );
task.setModuleProject( project );
task.setModuleArtifact( artifact );
final int dirMode = TypeConversionUtils.modeToInt( binaries.getDirectoryMode(), getLogger() );
if ( dirMode != -1 )
{
task.setDirectoryMode( dirMode );
}
final int fileMode = TypeConversionUtils.modeToInt( binaries.getFileMode(), getLogger() );
if ( fileMode != -1 )
{
task.setFileMode( fileMode );
}
task.setUnpack( binaries.isUnpack() );
if ( binaries.isUnpack() && binaries.getUnpackOptions() != null )
{
task.setIncludes( binaries.getUnpackOptions().getIncludes() );
task.setExcludes( binaries.getUnpackOptions().getExcludes() );
}
task.execute( archiver, configSource );
}