import java.io.*; import java.net.*; import java.util.jar.*; boolean result = true; try { File dir = new File( basedir, "target/include-project-artifact-1.0-SNAPSHOT-bin" ); System.out.println( "Checking for existence and file-ishness of: " + dir ); if ( !dir.exists() || !dir.isDirectory() ) { System.err.println( "assembled directory is missing or not a directory." ); return false; } File projectArtifact = new File( dir, "lib/include-project-artifact-1.0-SNAPSHOT.jar" ); System.out.println( "Looking for 'lib/include-project-artifact-1.0-SNAPSHOT.jar file in assembly." ); if ( !projectArtifact.exists() ) { System.err.println( "project-artifact entry is missing." ); return false; } System.out.println( "Looking for absence of 'lib/junit.jar' jar entry." ); if ( new File( dir, "lib/junit-3.8.1.jar" ).exists() ) { System.err.println( "junit jar should not be present." ); return false; } } catch( IOException e ) { e.printStackTrace(); result = false; } return result;