Startup time for CLI app much quicker now

The Boot resolver didn't transfer enough of the settings
of the default ChainResolver. Adding a boolean flag was
enough to make the chatter die down for dependencies
that were unneeded.

[Fixes #55358344] [bs-291]
This commit is contained in:
Dave Syer 2013-08-20 09:45:06 +01:00 committed by Phillip Webb
parent 3690ab16ba
commit b720f7e688
4 changed files with 29 additions and 16 deletions

View File

@ -0,0 +1,19 @@
package org.test
@Grab("org.codehaus.groovy.modules.http-builder:http-builder:0.5.2") // This one just to test dependency resolution
import groovyx.net.http.*
@Controller
class Example implements CommandLineRunner {
@RequestMapping("/")
@ResponseBody
public String helloWorld() {
return "World!"
}
void run(String... args) {
def world = new RESTClient("http://localhost:8080").get(path:"/").data.text
print "Hello " + world
}
}

View File

@ -83,6 +83,7 @@ class GrapeEngineCustomizer {
SpringBootResolver springBootResolver = new SpringBootResolver(
grapesResolver.getResolvers());
springBootResolver.setSettings(settings);
springBootResolver.setReturnFirst(grapesResolver.isReturnFirst());
springBootResolver.setName("springBoot");
if (!Boolean.getBoolean("disableSpringSnapshotRepos")) {

View File

@ -155,6 +155,13 @@ public class SampleIntegrationTests {
assertEquals("{\"message\":\"Hello World!\"}", result);
}
@Test
public void httpSample() throws Exception {
start("samples/http.groovy");
String output = this.outputCapture.getOutputAndRelease();
assertTrue("Wrong output: " + output, output.contains("Hello World"));
}
@Test
public void integrationSample() throws Exception {
start("samples/integration.groovy");

View File

@ -1,19 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } [%t] --- %-40.40logger{39} : %m%n%wex"/>
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
<!-- logger name="org.springframework" level="DEBUG"/-->
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<!-- logger name="org.springframework.web" level="DEBUG"/-->
</configuration>