Port the build to Gradle
Closes gh-19609 Closes gh-19608
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
@GrabResolver(name='clojars.org', root='https://clojars.org/repo')
|
||||
@Grab('redis.embedded:embedded-redis:0.2')
|
||||
|
||||
@Component
|
||||
class EmbeddedRedis {
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.test
|
||||
|
||||
@EnableGroovyTemplates
|
||||
@Component
|
||||
class Example implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private MyService myService
|
||||
|
||||
void run(String... args) {
|
||||
println "Hello ${this.myService.sayWorld()}"
|
||||
println getClass().getResource('/public/public.txt')
|
||||
println getClass().getResource('/resources/resource.txt')
|
||||
println getClass().getResource('/static/static.txt')
|
||||
println getClass().getResource('/templates/template.txt')
|
||||
println getClass().getResource('/root.properties')
|
||||
println template('template.txt', [world:'Mama'])
|
||||
}
|
||||
}
|
||||
|
||||
@Service
|
||||
class MyService {
|
||||
|
||||
String sayWorld() {
|
||||
return 'World!'
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Goodbye ${world}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.test
|
||||
|
||||
@Component
|
||||
class Example implements CommandLineRunner {
|
||||
|
||||
void run(String... args) {
|
||||
print "Ssshh"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<settings>
|
||||
<localRepository>../../../../build/local-m2-repository</localRepository>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>cli-test-repo</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>local.central</id>
|
||||
<url>file:../../../../build/test-repository</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.test
|
||||
|
||||
@RestController
|
||||
class WarExample implements CommandLineRunner {
|
||||
|
||||
@RequestMapping("/")
|
||||
public String hello() {
|
||||
return "Hello"
|
||||
}
|
||||
|
||||
void run(String... args) {
|
||||
println getClass().getResource('/org/apache/tomcat/InstanceManager.class')
|
||||
println getClass().getResource('/root.properties')
|
||||
throw new RuntimeException("onStart error")
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user