import java.io.*; import java.util.*; import java.util.jar.*; import java.util.regex.*; File jarFile = new File( basedir, "sub/target/sub-1.0.jar" ); System.out.println( "Checking for existence of " + jarFile ); if ( !jarFile.isFile() ) { throw new Exception( "Missing " + jarFile ); } JarFile jar = new JarFile( jarFile ); String[] includedEntries = { "META-INF/ejb-jar.xml", "org/apache/maven/Person.class", }; for ( String included : includedEntries ) { System.out.println( "Checking for existence of " + included ); if ( jar.getEntry( included ) == null ) { throw new Exception( "Missing " + included ); } } jar.close(); return true;