From 5af65a0674bdb4ce3b118802156d89b3d9433f0f Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 6 Nov 2006 13:37:55 +0000 Subject: [PATCH] adjusting to work with new manifest file that the maven plugin creates. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1003 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/PluginWrapper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 248fe9d02f..4b30cb4ee9 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -102,7 +102,13 @@ public final class PluginWrapper { if(isLinked) { // resolve the .hpl file to the location of the manifest file - archive = resolve(archive,new BufferedReader(new FileReader(archive)).readLine()); + String firstLine = new BufferedReader(new FileReader(archive)).readLine(); + if(firstLine.startsWith("Manifest-Version:")) { + // this is the manifest already + } else { + // in direction + archive = resolve(archive, firstLine); + } // then parse manifest FileInputStream in = new FileInputStream(archive); try { @@ -201,6 +207,7 @@ public final class PluginWrapper { private void parseClassPath(File archive, List paths, String attributeName, String separator) throws IOException { String classPath = manifest.getMainAttributes().getValue(attributeName); + if(classPath==null) return; // attribute not found for (String s : classPath.split(separator)) { File file = resolve(archive, s); if(file.getName().contains("*")) { -- GitLab