protected String getExecutableJar ( ) throws IOException { Manifest manifest = new Manifest ( ) ; manifest . getMainAttributes ( ) . put ( Attributes . Name . MANIFEST_VERSION , "1.0" ) ; manifest . getMainAttributes ( ) . put ( Attributes . Name . MAIN_CLASS , MAIN ) ; manifest . getMainAttributes ( ) . put ( Attributes . Name . CLASS_PATH , getClasspath ( ) ) ; Path jar = createTempDirectory ( "exec" ) . resolve ( "generate.jar" ) ; try ( JarOutputStream output = new JarOutputStream ( Files . newOutputStream ( jar ) , manifest ) ) { output . putNextEntry ( new JarEntry ( "allure.properties" ) ) ; Path allureConfig = PROPERTIES . getAllureConfig ( ) ; if ( Files . exists ( allureConfig ) ) { byte [ ] bytes = Files . readAllBytes ( allureConfig ) ; output . write ( bytes ) ; } output . closeEntry ( ) ; } return jar . toAbsolutePath ( ) . toString ( ) ; }
Create an executable jar to generate the report . Created jar contains only allure configuration file .