mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Previously, the default classpath was empty. Now, in the absence of the user providing a classpath via the -cp option, the default classpath will be ".". If the user does specify a classpath, the classpath that's used will be exactly what they have specified, i.e. "." will no longer be on the classpath unless specified by the user. The app sample integration test has been updated to verify that "." is only the classpath by default. Fixes #115
24 lines
344 B
Groovy
24 lines
344 B
Groovy
package org.test
|
|
|
|
@Component
|
|
class Example implements CommandLineRunner {
|
|
|
|
@Autowired
|
|
private MyService myService
|
|
|
|
void run(String... args) {
|
|
println "Hello ${this.myService.sayWorld()} From ${getClass().getClassLoader().getResource('samples/app.groovy')}"
|
|
}
|
|
}
|
|
|
|
|
|
@Service
|
|
class MyService {
|
|
|
|
String sayWorld() {
|
|
return "World!"
|
|
}
|
|
}
|
|
|
|
|