// impossible, since the test harness pulls in jenkins.war
thrownewAssertionError("jenkins.war is not in the classpath. If you are running this from the core workspace, run 'mvn install' to create the war image in war/target/jenkins. If running from a plugin, try using `mvn clean test` (cf. JENKINS-45245).");
File war =Which.jarFile(Class.forName("executable.Executable"));
if (winstone !=null) {
war =Which.jarFile(Class.forName("executable.Executable"));
} else {
// JENKINS-45245: work around incorrect test classpath in IDEA. Note that this will not correctly handle timestamped snapshots; in that case use `mvn test`.
File core =Which.jarFile(Jenkins.class); // will fail with IAE if have neither jenkins-war.war nor jenkins-core.jar in ${java.class.path}
String version = core.getParentFile().getName();
if (core.getName().equals("jenkins-core-"+ version +".jar") && core.getParentFile().getParentFile().getName().equals("jenkins-core")) {
war =newFile(newFile(newFile(core.getParentFile().getParentFile().getParentFile(), "jenkins-war"), version), "jenkins-war-"+ version +".war");
if (!war.isFile()) {
thrownewAssertionError(war +" does not yet exist. Prime your development environment by running `mvn validate`.");
}
LOGGER.log(Level.INFO, "{0} is the continuation of the classpath by other means", war);
} else {
thrownewAssertionError(core +" is not in the expected location, and jenkins-war-*.war was not in "+System.getProperty("java.class.path"));
}
}
// TODO this assumes that the CWD of the Maven process is the plugin ${basedir}, which may not be the case