import java.io.*; import java.util.jar.*; File targetDir = new File( basedir, "target" ); File mainJarFile = new File( targetDir, "test-1.0.jar" ); System.out.println( "Checking for existence of " + mainJarFile ); if ( !mainJarFile.isFile() ) { throw new Exception( "missing " + mainJarFile ); } JarFile mainJar = new JarFile( mainJarFile ); System.out.println( "Checking for existence of " + mainJarFile.getName() + "!/META-INF/TESTING.SF" ); if ( mainJar.getEntry( "META-INF/TESTING.SF" ) == null ) { throw new Exception( "missing " + mainJarFile.getName() + "!/META-INF/TESTING.SF" ); } System.out.println( "Checking for existence of " + mainJarFile.getName() + "!/META-INF/TESTING.DSA" ); if ( mainJar.getEntry( "META-INF/TESTING.DSA" ) == null ) { throw new Exception( "missing " + mainJarFile.getName() + "!/META-INF/TESTING.DSA" ); } mainJar.close(); File attachedJarFile = new File( targetDir, "test-1.0-sources.jar" ); System.out.println( "Checking for existence of " + attachedJarFile ); if ( !attachedJarFile.isFile() ) { throw new Exception( "missing " + attachedJarFile ); } JarFile attachedJar = new JarFile( attachedJarFile ); System.out.println( "Checking for existence of " + attachedJarFile.getName() + "!/META-INF/TESTING.SF" ); if ( attachedJar.getEntry( "META-INF/TESTING.SF" ) == null ) { throw new Exception( "missing " + attachedJarFile.getName() + "!/META-INF/TESTING.SF" ); } System.out.println( "Checking for existence of " + attachedJarFile.getName() + "!/META-INF/TESTING.DSA" ); if ( attachedJar.getEntry( "META-INF/TESTING.DSA" ) == null ) { throw new Exception( "missing " + attachedJarFile.getName() + "!/META-INF/TESTING.DSA" ); } attachedJar.close(); return true;