import java.io.*; import java.util.*; import java.util.jar.*; import java.util.regex.*; File jarFile = new File( basedir, "target/test-1.0.ear" ); System.out.println( "Checking for existence of " + jarFile ); if ( !jarFile.isFile() ) { throw new IllegalStateException( "Missing file: " + jarFile ); } JarFile jar = new JarFile( jarFile ); String[] includedEntries = { "META-INF/application.xml", "META-INF/appserver-application.xml", "META-INF/jboss-app.xml", }; for ( String included : includedEntries ) { System.out.println( "Checking for existence of " + included ); if ( jar.getEntry( included ) == null ) { throw new IllegalStateException( "Missing archive entry: " + included ); } } jar.close(); return true;