diff --git a/jetty-distribution/src/main/resources/modules/hawtio.mod b/jetty-distribution/src/main/resources/modules/hawtio.mod index 7b175f352d9..2dfb31b1506 100644 --- a/jetty-distribution/src/main/resources/modules/hawtio.mod +++ b/jetty-distribution/src/main/resources/modules/hawtio.mod @@ -15,6 +15,12 @@ etc/hawtio/ lib/hawtio/ https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-default/1.4.16/hawtio-default-1.4.16.war|lib/hawtio/hawtio.war +[license] +Hawtio is a redhat JBoss project released under the Apache License, v2.0 +http://hawt.io/ +http://github.com/hawtio/hawtio +http://www.apache.org/licenses/LICENSE-2.0.html + [ini-template] -Dhawtio.authenticationEnabled=false diff --git a/jetty-distribution/src/main/resources/modules/jamon.mod b/jetty-distribution/src/main/resources/modules/jamon.mod index 57af388aacd..2aeb2adcb8e 100644 --- a/jetty-distribution/src/main/resources/modules/jamon.mod +++ b/jetty-distribution/src/main/resources/modules/jamon.mod @@ -1,5 +1,5 @@ # -# JaMON Jetty module +# JAMon Jetty module # [depend] @@ -19,6 +19,11 @@ http://central.maven.org/maven2/com/jamonapi/jamon_war/2.79/jamon_war-2.79.war|l [lib] lib/jamon/**.jar +[license] +JAMon is a source forge hosted project released under a BSD derived license. +http://jamonapi.sourceforge.net +http://jamonapi.sourceforge.net/JAMonLicense.html + [ini-template] jamon.summaryLabels=default, request.getStatus().contextpath.value.ms #jamon.summaryLabels=demo diff --git a/jetty-distribution/src/main/resources/modules/jminix.mod b/jetty-distribution/src/main/resources/modules/jminix.mod index af334ff2194..b35d7024cd6 100644 --- a/jetty-distribution/src/main/resources/modules/jminix.mod +++ b/jetty-distribution/src/main/resources/modules/jminix.mod @@ -30,6 +30,11 @@ http://central.maven.org/maven2/org/jasypt/jasypt/1.8/jasypt-1.8.jar|lib/jminix/ [lib] lib/jminix/**.jar +[license] +JMiniX is a hosted at google code and released under the Apache License 2.0 +https://code.google.com/p/jminix/ +http://www.apache.org/licenses/LICENSE-2.0 + [ini-template] # Jminix Configuration jminix.port=8088 diff --git a/jetty-distribution/src/main/resources/modules/jolokia.mod b/jetty-distribution/src/main/resources/modules/jolokia.mod index d4c6eab659d..876c2fcd47c 100644 --- a/jetty-distribution/src/main/resources/modules/jolokia.mod +++ b/jetty-distribution/src/main/resources/modules/jolokia.mod @@ -13,3 +13,7 @@ etc/jolokia.xml [files] http://repo1.maven.org/maven2/org/jolokia/jolokia-war/1.2.2/jolokia-war-1.2.2.war|lib/jolokia/jolokia.war +[license] +Jolokia is released under the Apache License 2.0 +http://www.jolokia.org +http://www.apache.org/licenses/LICENSE-2.0 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 d19b85ca1f6..ce4cf601c9c 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 @@ -82,6 +82,7 @@ import org.eclipse.jetty.start.config.CommandLineConfigSource; public class Main { private static final int EXIT_USAGE = 1; + private static BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); public static String join(Collection objs, String delim) { @@ -372,6 +373,7 @@ public class Main StartLog.warn("ERROR: No known module for %s",name); return; } + // Find any named ini file and check it follows the convention Path start_ini = baseHome.getBasePath("start.ini"); @@ -393,8 +395,26 @@ public class Main boolean hasDefinedDefaults = module.getDefaultConfig().size() > 0; // If it is not enabled or is transitive with ini template lines or toplevel and doesn't exist - if (!module.isEnabled() || (transitive && hasDefinedDefaults) || (topLevel && !FS.exists(startd_ini) && !appendStartIni)) + if (!module.isEnabled() || (transitive && (hasDefinedDefaults || module.hasLicense()) ) || (topLevel && !FS.exists(startd_ini) && !appendStartIni)) { + if (module.hasLicense()) + { + System.err.printf("%nModule %s LICENSE%n",module.getName()); + System.err.printf("This module is not provided by the Eclipse Foundation!%n"); + System.err.printf("It contains software not covered by the Eclipse Public License%n"); + System.err.printf("The software has not been audited for compliance with its license%n"); + System.err.printf("%n"); + for (String l : module.getLicense()) + System.err.printf(" %s%n",l); + + System.err.printf("%nProceed (y/N)? "); + String line = input.readLine(); + + if (line==null || line.length()==0 || !line.toLowerCase().startsWith("y")) + System.exit(1); + } + + // File BufferedWriter BufferedWriter writer = null; String source = null; 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 dc0de1ced59..db9e40a5cd3 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 @@ -103,6 +103,8 @@ public class Module private List files; /** List of jvm Args */ private List jvmArgs; + /** License lines */ + private List license; /** Is this Module enabled via start.jar command line, start.ini, or start.d/*.ini ? */ private boolean enabled = false; @@ -263,6 +265,16 @@ public class Module return jvmArgs; } + public boolean hasLicense() + { + return license!=null && license.size()>0; + } + + public List getLicense() + { + return license; + } + @Override public int hashCode() { @@ -283,6 +295,7 @@ public class Module libs = new ArrayList<>(); files = new ArrayList<>(); jvmArgs = new ArrayList<>(); + license = new ArrayList<>(); String name = basehome.toShortForm(file); @@ -356,6 +369,10 @@ public class Module case "LIB": libs.add(line); break; + case "LICENSE": + case "LICENCE": + license.add(line); + break; case "NAME": logicalName = line; break;