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 d2b183ceef9..9f2de829a04 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 @@ -721,7 +721,7 @@ public class Main { for (Module module : args.getAllModules().resolveEnabled()) { - if (!module.acknowledgeLicense()) + if (!module.hasFiles(baseHome) && !module.acknowledgeLicense()) { StartLog.warn(EXITING_LICENSE_NOT_ACKNOWLEDGED); System.exit(1); diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java index d7fc0580aaf..5422aa169c1 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java @@ -58,6 +58,7 @@ public class LicenseTest int len = cmds.size(); String args[] = cmds.toArray(new String[len]); + System.err.printf("%n## Exec: %s%n", Main.join(cmds,", ")); Main main = new Main(); StartArgs startArgs = main.processCommandLine(args); main.start(startArgs); @@ -115,6 +116,32 @@ public class LicenseTest assertThat("Contents",contents,containsString("--module=spdy"+System.lineSeparator())); } + @Test + public void testAdd_HttpSpdy_Then_Deploy() throws Exception + { + File basePath = testdir.getEmptyDir(); + + List cmds = getBaseCommandLine(basePath); + + cmds.add("-Dorg.eclipse.jetty.start.ack.license.protonego-impl=true"); + cmds.add("--add-to-start=http,spdy"); + + execMain(cmds); + + String contents = assertFileExists(basePath, "start.ini"); + assertThat("Contents",contents,containsString("--module=http"+System.lineSeparator())); + assertThat("Contents",contents,containsString("--module=spdy"+System.lineSeparator())); + + // now request deploy (no license check should occur) + List cmds2 = getBaseCommandLine(basePath); + cmds2.add("--add-to-start=deploy"); + execMain(cmds2); + + contents = assertFileExists(basePath, "start.ini"); + assertThat("Contents",contents,containsString("--module=deploy"+System.lineSeparator())); + assertThat("Contents",contents,containsString("--module=spdy"+System.lineSeparator())); + } + @Test public void testCreate_SPDY_Licensed() throws Exception {