Skip to content

Commit 8ec4372

Browse files
authored
Merge pull request #928 from arunvenmany-ibm/springboot_multi_node_fix
changes for springbootappplication nodes in multiple config files
2 parents 484b2e7 + 7833806 commit 8ec4372

File tree

5 files changed

+84
-2
lines changed

5 files changed

+84
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ compileTestGroovy {
5757
}
5858

5959
def libertyAntVersion = "1.9.16"
60-
def libertyCommonVersion = "1.8.36"
60+
def libertyCommonVersion = "1.8.37-SNAPSHOT"
6161

6262
dependencies {
6363
implementation gradleApi()

src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,18 @@ public class TestSpringBootApplication30 extends AbstractIntegrationTest{
210210
try {
211211
BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart')
212212
String output = result.getOutput()
213-
assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration. Only one springBootApplication can be configured per Liberty server."))
213+
assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration file"))
214+
} catch (Exception e) {
215+
throw new AssertionError ("Fail on task deploy.", e)
216+
}
217+
}
218+
219+
@Test
220+
public void test_spring_boot_with_springbootapplication_nodes_apps_include_30() {
221+
try {
222+
BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart')
223+
String output = result.getOutput()
224+
assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration in files"))
214225
} catch (Exception e) {
215226
throw new AssertionError ("Fail on task deploy.", e)
216227
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<server description="new server">
3+
4+
<featureManager>
5+
<!-- tag::servlet[] -->
6+
<feature>servlet-6.0</feature>
7+
<!-- end::servlet[] -->
8+
<!-- tag::springboot[] -->
9+
<feature>springBoot-3.0</feature>
10+
<!-- end::springboot[] -->
11+
</featureManager>
12+
13+
<!-- tag::httpport[] -->
14+
<httpEndpoint id="defaultHttpEndpoint"
15+
host="*"
16+
httpPort="9080"
17+
httpsPort="9443" />
18+
<!-- end::httpport[] -->
19+
<include location="${server.config.dir}/included_server.xml"/>
20+
<springBootApplication id="guide-spring-boot"
21+
location="guide-spring-boot-0.1.0.jar"
22+
name="guide-spring-boot" />
23+
24+
<!-- end::springBootApplication[] -->
25+
26+
</server>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<server description="new server">
3+
<springBootApplication id="guide-spring-boot"
4+
location="guide-spring-boot-0.2.0.jar"
5+
name="guide-spring-boot" />
6+
</server>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
buildscript {
2+
ext {
3+
springBootVersion = '3.1.3'
4+
}
5+
repositories {
6+
mavenLocal()
7+
mavenCentral()
8+
maven {
9+
url "https://plugins.gradle.org/m2/"
10+
}
11+
}
12+
dependencies {
13+
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
14+
classpath "io.openliberty.tools:liberty-gradle-plugin:$lgpVersion"
15+
}
16+
}
17+
18+
apply plugin: 'java'
19+
apply plugin: 'org.springframework.boot'
20+
apply plugin: 'liberty'
21+
22+
group = 'liberty.gradle'
23+
version = '1.0-SNAPSHOT'
24+
sourceCompatibility = 17
25+
26+
repositories {
27+
mavenCentral()
28+
}
29+
dependencies {
30+
implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
31+
testImplementation('org.springframework.boot:spring-boot-starter-test')
32+
libertyRuntime group: 'io.openliberty', name: 'openliberty-runtime', version: '23.0.0.10'
33+
}
34+
35+
liberty {
36+
server {
37+
serverXmlFile = file("src/main/liberty/alternateConfig/server_springboot.xml")
38+
}
39+
}

0 commit comments

Comments
 (0)