@@ -29,12 +29,12 @@ Make sure the above pre-requisites are satisfied and that you are in the `spring
|
||||
To start the link:./src/main/java/app1/SpringPulsarBootApp.java[SpringPulsarBootApp] run the following command:
|
||||
[source,bash]
|
||||
----
|
||||
../gradlew bootRun -PsampleMainClass='app1.SpringPulsarBootApp'
|
||||
../gradlew bootRunApp1
|
||||
----
|
||||
|
||||
=== App2
|
||||
To start the link:./src/main/java/app2/FailoverConsumerApp.java[FailoverConsumerApp] run the following command:
|
||||
[source,bash]
|
||||
----
|
||||
../gradlew bootRun -PsampleMainClass='app2.FailoverConsumerApp'
|
||||
../gradlew bootRunApp2
|
||||
----
|
||||
|
||||
@@ -10,13 +10,24 @@ dependencies {
|
||||
implementation 'com.google.code.findbugs:jsr305'
|
||||
}
|
||||
|
||||
ext {
|
||||
sampleMainClass = project.hasProperty("sampleMainClass") ?
|
||||
project.getProperty("sampleMainClass") : "app1.SpringPulsarBootApp"
|
||||
springBoot {
|
||||
mainClass = 'app1.SpringPulsarBootApp' // default app to run
|
||||
}
|
||||
|
||||
springBoot {
|
||||
mainClass = sampleMainClass
|
||||
task bootRunApp1(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
|
||||
group = 'application'
|
||||
mainClass = 'app1.SpringPulsarBootApp'
|
||||
doFirst() {
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
task bootRunApp2(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
|
||||
group = 'application'
|
||||
mainClass = 'app2.FailoverConsumerApp'
|
||||
doFirst() {
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
|
||||
Reference in New Issue
Block a user