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:
parent
3690ab16ba
commit
b720f7e688
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -83,6 +83,7 @@ class GrapeEngineCustomizer {
|
||||||
SpringBootResolver springBootResolver = new SpringBootResolver(
|
SpringBootResolver springBootResolver = new SpringBootResolver(
|
||||||
grapesResolver.getResolvers());
|
grapesResolver.getResolvers());
|
||||||
springBootResolver.setSettings(settings);
|
springBootResolver.setSettings(settings);
|
||||||
|
springBootResolver.setReturnFirst(grapesResolver.isReturnFirst());
|
||||||
springBootResolver.setName("springBoot");
|
springBootResolver.setName("springBoot");
|
||||||
|
|
||||||
if (!Boolean.getBoolean("disableSpringSnapshotRepos")) {
|
if (!Boolean.getBoolean("disableSpringSnapshotRepos")) {
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,13 @@ public class SampleIntegrationTests {
|
||||||
assertEquals("{\"message\":\"Hello World!\"}", result);
|
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
|
@Test
|
||||||
public void integrationSample() throws Exception {
|
public void integrationSample() throws Exception {
|
||||||
start("samples/integration.groovy");
|
start("samples/integration.groovy");
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } [%t] --- %-40.40logger{39} : %m%n%wex"/>
|
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||||
|
<!-- logger name="org.springframework.web" level="DEBUG"/-->
|
||||||
<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"/-->
|
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue