import java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/nma2/test/maven-metadata-local.xml", "org/apache/maven/its/install/nma2/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/nma2/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", "org/apache/maven/its/install/nma2/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-it.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true;