Browse Source

Resolve DTD locations relative to project basedir

Also more into when dependency analyzer cannot be found.

PR:	13271


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274065 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
039da0c823
2 changed files with 10 additions and 3 deletions
  1. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
  2. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java

+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java View File

@@ -1,7 +1,7 @@
/* /*
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved. * reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -159,6 +159,11 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
} }


File fileDTD = new File(location); File fileDTD = new File(location);
if (!fileDTD.exists()) {
// resolve relative to project basedir
fileDTD = owningTask.getProject().resolveFile(location);
}
if (fileDTD.exists()) { if (fileDTD.exists()) {
if (publicId != null) { if (publicId != null) {
fileDTDs.put(publicId, fileDTD); fileDTDs.put(publicId, fileDTD);


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java View File

@@ -315,11 +315,13 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
dependencyAnalyzer.addClassPath(config.classpath); dependencyAnalyzer.addClassPath(config.classpath);
} catch (NoClassDefFoundError e) { } catch (NoClassDefFoundError e) {
dependencyAnalyzer = null; dependencyAnalyzer = null;
task.log("Unable to load dependency analyzer: " + analyzerClassName,
task.log("Unable to load dependency analyzer: " + analyzerClassName
+ " - dependent class not found: " + e.getMessage(),
Project.MSG_WARN); Project.MSG_WARN);
} catch (Exception e) { } catch (Exception e) {
dependencyAnalyzer = null; dependencyAnalyzer = null;
task.log("Unable to load dependency analyzer: " + analyzerClassName,
task.log("Unable to load dependency analyzer: " + analyzerClassName
+ " - exception: " + e.getMessage(),
Project.MSG_WARN); Project.MSG_WARN);
} }
} }


Loading…
Cancel
Save