diff options
author | acolyer <acolyer> | 2005-11-08 16:41:54 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-11-08 16:41:54 +0000 |
commit | 1f5149913ee859e466602f99a210dd76e0ade8ed (patch) | |
tree | 5b63a139a477670cb6dc89f1cfec49db78fe2057 /org.aspectj.ajdt.core | |
parent | ae53e0442c32cdb4d37d46a74c2eed0fb8f795d3 (diff) | |
download | aspectj-1f5149913ee859e466602f99a210dd76e0ade8ed.tar.gz aspectj-1f5149913ee859e466602f99a210dd76e0ade8ed.zip |
fix for pr112830, tolerate variations on "aspectjrt.jar" for Maven.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 004ab6534..622eb02d9 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -992,16 +992,20 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc } if (buildConfig == null || buildConfig.getFullClasspath() == null) return "no classpath specified"; + + String ret = null; for (Iterator it = buildConfig.getFullClasspath().iterator(); it.hasNext(); ) { File p = new File( (String)it.next() ); - if (p.isFile() && p.getName().equals("aspectjrt.jar")) { + // pr112830, allow variations on aspectjrt.jar of the form aspectjrtXXXXXX.jar + if (p.isFile() && p.getName().startsWith("aspectjrt") && p.getName().endsWith(".jar")) { try { String version = null; Manifest manifest = new JarFile(p).getManifest(); if (manifest == null) { - return "no manifest found in " + p.getAbsolutePath() + + ret = "no manifest found in " + p.getAbsolutePath() + ", expected " + Version.text; + continue; } Attributes attr = manifest.getAttributes("org/aspectj/lang/"); if (null != attr) { @@ -1017,18 +1021,21 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc // p.getAbsolutePath()); return null; } else if (!Version.text.equals(version)) { - return "bad version number found in " + p.getAbsolutePath() + + ret = "bad version number found in " + p.getAbsolutePath() + " expected " + Version.text + " found " + version; + continue; } } catch (IOException ioe) { - return "bad jar file found in " + p.getAbsolutePath() + " error: " + ioe; + ret = "bad jar file found in " + p.getAbsolutePath() + " error: " + ioe; } - return null; + return null; // this is the "OK" return value! } else { // might want to catch other classpath errors } } + if (ret != null) return ret; // last error found in potentially matching jars... + return "couldn't find aspectjrt.jar on classpath, checked: " + makeClasspathString(buildConfig); } |