From 2141cc2dc34160cc76d9919e6c41b26fca19078c Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 23 Feb 2015 16:49:07 -0700 Subject: [PATCH] 459273 - Redundant license notices + Only showing license acknowledgement request screen if [FILES] section contains content that does not (yet) exist --- .../main/java/org/eclipse/jetty/start/Main.java | 2 +- .../java/org/eclipse/jetty/start/Module.java | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index 14930272daf..d2b183ceef9 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -407,7 +407,7 @@ public class Main if (!args.isApproveAllLicenses()) { - if (!module.acknowledgeLicense()) + if (!module.hasFiles(baseHome) && !module.acknowledgeLicense()) { StartLog.warn(EXITING_LICENSE_NOT_ACKNOWLEDGED); System.exit(1); diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java index 33d9a8c112d..f1be5043aa4 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java @@ -279,7 +279,7 @@ public class Module { return true; } - + System.err.printf("%nModule %s:%n",getName()); System.err.printf(" + contains software not provided by the Eclipse Foundation!%n"); System.err.printf(" + contains software not covered by the Eclipse Public License!%n"); @@ -361,6 +361,20 @@ public class Module return enabled; } + public boolean hasFiles(BaseHome baseHome) + { + for (String ref : getFiles()) + { + FileArg farg = new FileArg(this,ref); + Path refPath = baseHome.getBasePath(farg.location); + if (!Files.exists(refPath)) + { + return false; + } + } + return true; + } + public void process(BaseHome basehome) throws FileNotFoundException, IOException { Pattern section = Pattern.compile("\\s*\\[([^]]*)\\]\\s*"); @@ -477,5 +491,4 @@ public class Module str.append(']'); return str.toString(); } - }