Merge remote-tracking branch 'origin/jetty-9.4.x'
This commit is contained in:
commit
003e9cd302
|
@ -9,6 +9,8 @@ annotations
|
|||
webapp
|
||||
sessions
|
||||
sessions/gcloud/${type}
|
||||
jcl-api
|
||||
jcl-impl
|
||||
|
||||
[files]
|
||||
maven://com.google.gcloud/gcloud-java-datastore/0.0.7|lib/gcloud/gcloud-java-datastore-0.0.7.jar
|
||||
|
@ -21,7 +23,6 @@ maven://com.google.http-client/google-http-client/1.20.0|lib/gcloud/google-http-
|
|||
maven://com.google.code.findbugs/jsr305/1.3.9|lib/gcloud/jsr305-1.3.9.jar
|
||||
maven://org.apache.httpcomponents/httpclient/4.0.1|lib/gcloud/httpclient-4.0.1.jar
|
||||
maven://org.apache.httpcomponents/httpcore/4.0.1|lib/gcloud/httpcore-4.0.1.jar
|
||||
maven://commons-logging/commons-logging/1.1.1|lib/gcloud/commons-logging-1.1.1.jar
|
||||
maven://commons-codec/commons-codec/1.3|lib/gcloud/commons-codec-1.3.jar
|
||||
maven://com.google.oauth-client/google-oauth-client/1.20.0|lib/gcloud//google-oauth-client-1.20.0.jar
|
||||
maven://com.google.guava/guava/18.0|lib/gcloud/guava-18.0.jar
|
||||
|
|
|
@ -4,6 +4,8 @@ Deploys the Jminix JMX Console within the server
|
|||
[depend]
|
||||
stats
|
||||
jmx
|
||||
jcl-api
|
||||
jcl-impl
|
||||
|
||||
[xml]
|
||||
etc/jminix.xml
|
||||
|
@ -17,7 +19,6 @@ maven://org.apache.velocity/velocity/1.5|lib/jminix/velocity-1.5.jar
|
|||
maven://oro/oro/2.0.8|lib/jminix/oro-2.0.8.jar
|
||||
http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet/1.1.5/com.noelios.restlet-1.1.5.jar|lib/jminix/com.noelios.restlet-1.1.5.jar
|
||||
http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet.ext.servlet/1.1.5/com.noelios.restlet.ext.servlet-1.1.5.jar|lib/jminix/com.noelios.restlet.ext.servlet-1.1.5.jar
|
||||
maven://commons-logging/commons-logging/1.1.1|lib/jminix/commons-logging-1.1.1.jar
|
||||
maven://net.sf.json-lib/json-lib/2.2.3/jar/jdk15|lib/jminix/json-lib-2.2.3-jdk15.jar
|
||||
maven://commons-lang/commons-lang/2.4|lib/jminix/commons-lang-2.4.jar
|
||||
maven://commons-beanutils/commons-beanutils/1.7.0|lib/jminix/commons-beanutils-1.7.0.jar
|
||||
|
|
|
@ -91,7 +91,6 @@ public class MemcachedSessionDataMap implements SessionDataMap
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ etc/jetty-ssl.xml
|
|||
etc/jetty-ssl-context.xml
|
||||
|
||||
[files]
|
||||
https://raw.githubusercontent.com/eclipse/jetty.project/master/jetty-server/src/test/config/etc/keystore?id=${jetty.tag.version}|etc/keystore
|
||||
basehome:modules/ssl/keystore|etc/keystore
|
||||
|
||||
[ini-template]
|
||||
### TLS(SSL) Connector Configuration
|
||||
|
|
|
@ -113,24 +113,23 @@ public class BaseBuilder
|
|||
Modules modules = startArgs.getAllModules();
|
||||
|
||||
// Select all the added modules to determine which ones are newly enabled
|
||||
// TODO this does not look correct????
|
||||
Set<String> enabled = new HashSet<>();
|
||||
Set<String> startModules = new HashSet<>();
|
||||
|
||||
|
||||
Set<String> newly_enabled = new HashSet<>();
|
||||
if (!startArgs.getStartModules().isEmpty())
|
||||
{
|
||||
for (String name:startArgs.getStartModules())
|
||||
startModules.addAll(modules.select(name,"--add-to-start[d]"));
|
||||
enabled.addAll(startModules);
|
||||
newly_enabled.addAll(modules.enable(name,"--add-to-start[d]"));
|
||||
}
|
||||
|
||||
if (StartLog.isDebugEnabled())
|
||||
StartLog.debug("start[d]=%s",startModules);
|
||||
StartLog.debug("start[d]=%s",newly_enabled);
|
||||
|
||||
// Check the licenses
|
||||
if (startArgs.isLicenseCheckRequired())
|
||||
{
|
||||
Licensing licensing = new Licensing();
|
||||
for (String name : enabled)
|
||||
for (String name : newly_enabled)
|
||||
licensing.addModule(modules.get(name));
|
||||
|
||||
if (licensing.hasLicenses())
|
||||
|
@ -152,7 +151,7 @@ public class BaseBuilder
|
|||
AtomicReference<BaseBuilder.Config> builder = new AtomicReference<>();
|
||||
AtomicBoolean modified = new AtomicBoolean();
|
||||
|
||||
if (!startModules.isEmpty())
|
||||
if (!newly_enabled.isEmpty())
|
||||
{
|
||||
Path startd = getBaseHome().getBasePath("start.d");
|
||||
Path startini = getBaseHome().getBasePath("start.ini");
|
||||
|
@ -167,7 +166,7 @@ public class BaseBuilder
|
|||
|
||||
boolean useStartD=startArgs.isUseStartd() || Files.exists(startd);
|
||||
builder.set(useStartD?new StartDirBuilder(this):new StartIniBuilder(this));
|
||||
startModules.stream().map(n->modules.get(n)).forEach(module ->
|
||||
newly_enabled.stream().map(n->modules.get(n)).forEach(module ->
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -187,7 +186,7 @@ public class BaseBuilder
|
|||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
files.addAll(startArgs.getFiles());
|
||||
|
@ -242,7 +241,8 @@ public class BaseBuilder
|
|||
}
|
||||
}
|
||||
|
||||
System.err.println("Failed to initialize: "+arg.uri+"|"+arg.location);
|
||||
if (!FS.exists(file))
|
||||
System.err.println("Failed to initialize: "+arg.uri+"|"+arg.location);
|
||||
|
||||
return modified;
|
||||
}
|
||||
|
|
|
@ -97,8 +97,8 @@ public class Main
|
|||
t.printStackTrace(System.err);
|
||||
}
|
||||
System.err.println();
|
||||
System.err.println("Usage: java -jar start.jar [options] [properties] [configs]");
|
||||
System.err.println(" java -jar start.jar --help # for more information");
|
||||
System.err.println("Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs]");
|
||||
System.err.println(" java -jar $JETTY_HOME/start.jar --help # for more information");
|
||||
|
||||
if (test)
|
||||
System.err.println("EXIT: "+exit);
|
||||
|
@ -301,7 +301,7 @@ public class Main
|
|||
for (String source : args.getSources(enabledModule))
|
||||
{
|
||||
String shortForm = baseHome.toShortForm(source);
|
||||
modules.select(enabledModule,shortForm);
|
||||
modules.enable(enabledModule,shortForm);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -349,10 +349,6 @@ public class Main
|
|||
// ------------------------------------------------------------
|
||||
// 9) Resolve Property Files
|
||||
args.resolvePropertyFiles(baseHome);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 10) Check enabled modules
|
||||
args.getAllModules().checkEnabledModules();
|
||||
|
||||
return args;
|
||||
}
|
||||
|
@ -418,7 +414,10 @@ public class Main
|
|||
StartLog.info("Base directory was modified");
|
||||
else if (args.isDownload() || !args.getStartModules().isEmpty())
|
||||
StartLog.info("Base directory was not modified");
|
||||
|
||||
|
||||
// Check module dependencies
|
||||
args.getAllModules().checkEnabledModules();
|
||||
|
||||
// Informational command line, don't run jetty
|
||||
if (!args.isRun())
|
||||
{
|
||||
|
|
|
@ -402,16 +402,25 @@ public class Module
|
|||
public String toString()
|
||||
{
|
||||
StringBuilder str = new StringBuilder();
|
||||
str.append(getName()).append('{');
|
||||
str.append(getName());
|
||||
char sep='{';
|
||||
if (isDynamic())
|
||||
{
|
||||
str.append(sep).append("dynamic");
|
||||
sep=',';
|
||||
}
|
||||
if (isEnabled())
|
||||
{
|
||||
str.append("enabled");
|
||||
if (isTransitive())
|
||||
str.append(",transitive");
|
||||
str.append(sep).append("enabled");
|
||||
sep=',';
|
||||
}
|
||||
else if (isTransitive())
|
||||
str.append("transitive");
|
||||
str.append('}');
|
||||
if (isTransitive())
|
||||
{
|
||||
str.append(sep).append("transitive");
|
||||
sep=',';
|
||||
}
|
||||
if (sep!='{')
|
||||
str.append('}');
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -221,7 +221,12 @@ public class Modules implements Iterable<Module>
|
|||
return _modules.stream().filter(m->{return m.isEnabled();}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Set<String> select(String name, String enabledFrom)
|
||||
/** Enable a module
|
||||
* @param name The name of the module to enable
|
||||
* @param enabledFrom The source the module was enabled from
|
||||
* @return The set of modules newly enabled
|
||||
*/
|
||||
public Set<String> enable(String name, String enabledFrom)
|
||||
{
|
||||
Module module = get(name);
|
||||
if (module==null)
|
||||
|
@ -347,6 +352,7 @@ public class Modules implements Iterable<Module>
|
|||
|
||||
public void checkEnabledModules()
|
||||
{
|
||||
StringBuilder unsatisfied=new StringBuilder();
|
||||
_modules.stream().filter(Module::isEnabled).forEach(m->
|
||||
{
|
||||
// Check dependencies
|
||||
|
@ -354,9 +360,17 @@ public class Modules implements Iterable<Module>
|
|||
{
|
||||
Set<Module> providers =_provided.get(d);
|
||||
if (providers.stream().filter(Module::isEnabled).count()==0)
|
||||
throw new UsageException(-1,"Module %s requires %s from one of %s",m.getName(),d,providers);
|
||||
{
|
||||
if (unsatisfied.length()>0)
|
||||
unsatisfied.append(',');
|
||||
unsatisfied.append(m.getName());
|
||||
System.err.printf("%nWARN: Module %s requires %s from one of %s%n",m.getName(),d,providers);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (unsatisfied.length()>0)
|
||||
throw new UsageException(-1,"Unsatisfied module dependencies: "+unsatisfied);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -166,8 +166,8 @@ public class ModulesTest
|
|||
modules.registerAll();
|
||||
|
||||
// Enable 2 modules
|
||||
modules.select("base",TEST_SOURCE);
|
||||
modules.select("optional",TEST_SOURCE);
|
||||
modules.enable("base",TEST_SOURCE);
|
||||
modules.enable("optional",TEST_SOURCE);
|
||||
modules.sort();
|
||||
|
||||
// Collect active module list
|
||||
|
|
|
@ -133,6 +133,7 @@ public class TestUseCases
|
|||
}
|
||||
|
||||
StartArgs args = main.processCommandLine(cmdLine);
|
||||
args.getAllModules().checkEnabledModules();
|
||||
BaseHome baseHome = main.getBaseHome();
|
||||
ConfigurationAssert.assertConfiguration(baseHome,args,assertFile);
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
EX|UsageException: Module dependent requires alternate from one of
|
||||
EX|UsageException: Unsatisfied module dependencies
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
[description]
|
||||
Provides JCL implementation that routes logs into slf4j
|
||||
|
||||
[depends]
|
||||
slf4j-api
|
||||
|
||||
[provides]
|
||||
jcl-impl
|
||||
jcl-api
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/jcl-over-slf4j/1.7.21|lib/slf4j/jcl-over-slf4j-1.7.21.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/jcl-over-slf4j-1.7.21.jar
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
[description]
|
||||
Provides Apache Java Commons Logging API and implementation
|
||||
|
||||
[depends]
|
||||
|
||||
[provides]
|
||||
jcl-api
|
||||
jcl-impl
|
||||
|
||||
[files]
|
||||
maven://commons-logging/commons-logging/1.1.3|lib/jcl/commons-logging-1.1.3.jar
|
||||
|
||||
[lib]
|
||||
lib/jcl/commons-logging-1.1.3.jar
|
||||
|
||||
[license]
|
||||
Log4j is released under the Apache 2.0 license.
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
|
@ -0,0 +1,12 @@
|
|||
[description]
|
||||
Enables Java util logging
|
||||
|
||||
[depends]
|
||||
resources
|
||||
|
||||
[provide]
|
||||
logging
|
||||
|
||||
[files]
|
||||
basehome:modules/jetty-logging/jetty-logging.properties|resources/jetty-logging.properties
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
## Setup jetty logging implementation
|
||||
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
|
||||
|
||||
## Levels are ALL, DEBUG, INFO, WARN, OFF
|
||||
org.eclipse.jetty.LEVEL=INFO
|
||||
#com.example.LEVEL=INFO
|
||||
|
||||
## Hide stacks traces in logs?
|
||||
#com.example.STACKS=false
|
||||
|
||||
## Show the source file of a log location?
|
||||
#com.example.SOURCE=false
|
|
@ -0,0 +1,12 @@
|
|||
[description]
|
||||
Configure Jetty logging to use SLF4J
|
||||
|
||||
[depend]
|
||||
slf4j-api
|
||||
slf4j-impl
|
||||
|
||||
[provide]
|
||||
logging
|
||||
|
||||
[exec]
|
||||
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
|
|
@ -0,0 +1,18 @@
|
|||
[description]
|
||||
Provides SLF4J bridge to apache java commons logging
|
||||
|
||||
[depend]
|
||||
slf4j-api
|
||||
jcl-api
|
||||
|
||||
[provide]
|
||||
slf4j-impl
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/slf4j-jcl/1.7.21|lib/slf4j/slf4j-jcl-1.7.21.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/slf4j-jcl-1.7.21.jar
|
||||
|
||||
[exec]
|
||||
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
|
|
@ -0,0 +1,16 @@
|
|||
[description]
|
||||
Provides SLF4J Log4j implementation.
|
||||
|
||||
[depend]
|
||||
slf4j-api
|
||||
log4j-api
|
||||
|
||||
[provide]
|
||||
slf4j-impl
|
||||
|
||||
[files]
|
||||
maven://org.slf4j/slf4j-log4j12/1.7.21|lib/slf4j/slf4j-log4j12-1.7.21.jar
|
||||
|
||||
[lib]
|
||||
lib/slf4j/slf4j-log4j12-1.7.21.jar
|
||||
|
|
@ -3,7 +3,7 @@ Redirects JVMs stderr and stdout to a log file,
|
|||
including output from Jetty's default StdErrLog logging.
|
||||
|
||||
[xml]
|
||||
etc/jetty-logging.xml
|
||||
etc/stderrout-logging.xml
|
||||
|
||||
[files]
|
||||
logs/
|
Loading…
Reference in New Issue