Skip to content

Commit c3d71bb

Browse files
committed
Set banner mode to OFF instead of overriding printBanner method
1 parent 6671893 commit c3d71bb

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

grails-core/src/main/groovy/grails/boot/GrailsApp.groovy

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import grails.util.BuildSettings
99
import grails.util.Environment
1010
import groovy.transform.CompileDynamic
1111
import groovy.transform.CompileStatic
12-
import groovy.transform.InheritConstructors
1312
import groovy.util.logging.Slf4j
1413
import org.codehaus.groovy.control.CompilationFailedException
1514
import org.codehaus.groovy.control.CompilationUnit
@@ -22,9 +21,11 @@ import org.grails.io.watch.DirectoryWatcher
2221
import org.grails.io.watch.FileExtensionFileChangeListener
2322
import org.grails.plugins.BinaryGrailsPlugin
2423
import org.grails.plugins.support.WatchPattern
24+
import org.springframework.boot.Banner
2525
import org.springframework.boot.SpringApplication
2626
import org.springframework.context.ConfigurableApplicationContext
2727
import org.springframework.core.env.ConfigurableEnvironment
28+
import org.springframework.core.io.ResourceLoader
2829

2930
import java.util.concurrent.ConcurrentLinkedQueue
3031

@@ -36,7 +37,6 @@ import java.util.concurrent.ConcurrentLinkedQueue
3637
* @since 3.0
3738
*/
3839
@CompileStatic
39-
@InheritConstructors
4040
@Slf4j
4141
class GrailsApp extends SpringApplication {
4242

@@ -45,6 +45,35 @@ class GrailsApp extends SpringApplication {
4545

4646
boolean enableBeanCreationProfiler = false
4747

48+
/**
49+
* Create a new {@link GrailsApp} instance. The application context will load
50+
* beans from the specified sources (see {@link SpringApplication class-level}
51+
* documentation for details. The instance can be customized before calling
52+
* {@link #run(String...)}.
53+
* @param sources the bean sources
54+
* @see #run(Object, String[])
55+
* @see #GrailsApp(org.springframework.core.io.ResourceLoader, Object...)
56+
*/
57+
public GrailsApp(Object... sources) {
58+
super(sources)
59+
bannerMode = Banner.Mode.OFF
60+
}
61+
62+
/**
63+
* Create a new {@link GrailsApp} instance. The application context will load
64+
* beans from the specified sources (see {@link SpringApplication class-level}
65+
* documentation for details. The instance can be customized before calling
66+
* {@link #run(String...)}.
67+
* @param resourceLoader the resource loader to use
68+
* @param sources the bean sources
69+
* @see #run(Object, String[])
70+
* @see #GrailsApp(org.springframework.core.io.ResourceLoader, Object...)
71+
*/
72+
public GrailsApp(ResourceLoader resourceLoader, Object... sources) {
73+
super(resourceLoader, sources)
74+
bannerMode = Banner.Mode.OFF
75+
}
76+
4877
@Override
4978
ConfigurableApplicationContext run(String... args) {
5079
def applicationContext = super.run(args)
@@ -330,11 +359,6 @@ class GrailsApp extends SpringApplication {
330359
}
331360
}
332361

333-
@Override
334-
protected void printBanner(org.springframework.core.env.Environment environment) {
335-
// noop
336-
}
337-
338362
/**
339363
* Static helper that can be used to run a {@link GrailsApp} from the
340364
* specified source using default settings.

0 commit comments

Comments
 (0)