Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-58362] Create ${TestPluginManager.rootDir}/${artifactId}.jpl, not the.jpl #146

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/main/java/org/jvnet/hudson/test/TestPluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.net.URISyntaxException;
Expand All @@ -40,6 +41,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.jar.Manifest;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -104,8 +106,15 @@ private Set<String> loadBundledPlugins(File fromDir) throws IOException, URISynt
u = getClass().getClassLoader().getResource("the.hpl"); // keep backward compatible
}
if (u!=null) try {
names.add("the.jpl");
copyBundledPlugin(u, "the.jpl");
String thisPlugin;
try (InputStream is = u.openStream()) {
thisPlugin = new Manifest(is).getMainAttributes().getValue("Short-Name");
}
if (thisPlugin == null) {
throw new IOException("malformed " + u);
}
names.add(thisPlugin + ".jpl");
copyBundledPlugin(u, thisPlugin + ".jpl");
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Failed to copy the.jpl",e);
}
Expand Down Expand Up @@ -133,6 +142,7 @@ private Set<String> loadBundledPlugins(File fromDir) throws IOException, URISynt
throw new IOException(index + " contains bogus line " + line, x);
}
}
// TODO should this be running names.add(line + ".jpi")? Affects PluginWrapper.isBundled & .*Dependents
if(f.exists()){
copyBundledPlugin(url, line + ".jpi");
}else{
Expand Down