private File createArchive ( ) throws Exception { getLog ( ) . info ( "Creating archive." ) ; Artifact artifact = mavenProject . getArtifact ( ) ; String clsfr = noclassifier ? "" : ( "-" + classifier ) ; String archiveName = artifact . getArtifactId ( ) + "-" + artifact . getVersion ( ) + clsfr + ".jar" ; File jarFile = new File ( mavenProject . getBuild ( ) . getDirectory ( ) , archiveName ) ; MavenArchiver archiver = new MavenArchiver ( ) ; jarArchiver . addDirectory ( stagingDirectory ) ; archiver . setArchiver ( jarArchiver ) ; archiver . setOutputFile ( jarFile ) ; archiver . createArchive ( mavenSession , mavenProject , archiveConfig ) ; if ( noclassifier ) { artifact . setFile ( jarFile ) ; } else { projectHelper . attachArtifact ( mavenProject , jarFile , classifier ) ; } FileUtils . deleteDirectory ( stagingDirectory ) ; return jarFile ; }
Creates the archive from data in the staging directory .