From c89943bb8a22571e48f09854399ba51801c7d986 Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Mon, 30 Dec 2024 13:00:12 +0530 Subject: [PATCH 1/6] changes for springbootappplication nodes in multiple config files Signed-off-by: Arun Venmany --- build.gradle | 2 +- .../gradle/TestSpringBootApplication30.groovy | 11 ++++++ .../alternateConfig/server_springboot.xml | 26 +++++++++++++ .../main/liberty/config/included_server.xml | 6 +++ ...otapplication_nodes_apps_include_30.gradle | 39 +++++++++++++++++++ 5 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/sample.springboot3/src/main/liberty/alternateConfig/server_springboot.xml create mode 100644 src/test/resources/sample.springboot3/src/main/liberty/config/included_server.xml create mode 100644 src/test/resources/sample.springboot3/test_spring_boot_with_springbootapplication_nodes_apps_include_30.gradle diff --git a/build.gradle b/build.gradle index c203ce07..beecbf4e 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ compileTestGroovy { } def libertyAntVersion = "1.9.16" -def libertyCommonVersion = "1.8.36" +def libertyCommonVersion = "1.8.37-SNAPSHOT" dependencies { implementation gradleApi() diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy index c017bfd2..8259e123 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy @@ -216,5 +216,16 @@ public class TestSpringBootApplication30 extends AbstractIntegrationTest{ } } + @Test + public void test_spring_boot_with_springbootapplication_nodes_apps_include_30() { + try { + BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart') + String output = result.getOutput() + assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration. Only one springBootApplication can be configured per Liberty server.")) + } catch (Exception e) { + throw new AssertionError ("Fail on task deploy.", e) + } + } + } diff --git a/src/test/resources/sample.springboot3/src/main/liberty/alternateConfig/server_springboot.xml b/src/test/resources/sample.springboot3/src/main/liberty/alternateConfig/server_springboot.xml new file mode 100644 index 00000000..7a542c04 --- /dev/null +++ b/src/test/resources/sample.springboot3/src/main/liberty/alternateConfig/server_springboot.xml @@ -0,0 +1,26 @@ + + + + + + servlet-6.0 + + + springBoot-3.0 + + + + + + + + + + + + diff --git a/src/test/resources/sample.springboot3/src/main/liberty/config/included_server.xml b/src/test/resources/sample.springboot3/src/main/liberty/config/included_server.xml new file mode 100644 index 00000000..9c2cb215 --- /dev/null +++ b/src/test/resources/sample.springboot3/src/main/liberty/config/included_server.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/src/test/resources/sample.springboot3/test_spring_boot_with_springbootapplication_nodes_apps_include_30.gradle b/src/test/resources/sample.springboot3/test_spring_boot_with_springbootapplication_nodes_apps_include_30.gradle new file mode 100644 index 00000000..d23c9727 --- /dev/null +++ b/src/test/resources/sample.springboot3/test_spring_boot_with_springbootapplication_nodes_apps_include_30.gradle @@ -0,0 +1,39 @@ +buildscript { + ext { + springBootVersion = '3.1.3' + } + repositories { + mavenLocal() + mavenCentral() + maven { + url "https://plugins.gradle.org/m2/" + } + } + dependencies { + classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" + classpath "io.openliberty.tools:liberty-gradle-plugin:$lgpVersion" + } +} + +apply plugin: 'java' +apply plugin: 'org.springframework.boot' +apply plugin: 'liberty' + +group = 'liberty.gradle' +version = '1.0-SNAPSHOT' +sourceCompatibility = 17 + +repositories { + mavenCentral() +} +dependencies { + implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") + testImplementation('org.springframework.boot:spring-boot-starter-test') + libertyRuntime group: 'io.openliberty', name: 'openliberty-runtime', version: '23.0.0.10' +} + +liberty { + server { + serverXmlFile = file("src/main/liberty/alternateConfig/server_springboot.xml") + } +} \ No newline at end of file From abce4ba34bda5c85bfb50d5c89335d576ec44518 Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Wed, 1 Jan 2025 10:54:15 +0530 Subject: [PATCH 2/6] adding changes for workflow.yaml Signed-off-by: Arun Venmany --- .github/workflows/gradle.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8e6c47d5..6cfefe50 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -39,8 +39,9 @@ jobs: - name: Checkout ci.common uses: actions/checkout@v3 with: - repository: OpenLiberty/ci.common + repository: arunvenmany-ibm/ci.common path: ci.common + ref: springboot_multi_node_fix - name: Checkout ci.ant uses: actions/checkout@v3 with: @@ -124,7 +125,7 @@ jobs: - name: Clone ci.ant, ci.common, ci.gradle repos to C drive run: | cp -r D:/a/ci.gradle/ci.gradle C:/ci.gradle - git clone https://github.com/OpenLiberty/ci.common.git C:/ci.common + git clone https://github.com/arunvenmany-ibm/ci.common.git --branch springboot_multi_node_fix --single-branch C:/ci.common git clone https://github.com/OpenLiberty/ci.ant.git C:/ci.ant # Cache mvn/gradle packages - name: Cache Maven packages From 770514a76cd14e16b2eec2e39cebd6a6f4b1233b Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Thu, 9 Jan 2025 11:55:38 +0530 Subject: [PATCH 3/6] updating tests based on ci.common changes Signed-off-by: Arun Venmany --- .../tools/gradle/TestSpringBootApplication30.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy index 8259e123..9eb3177d 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy @@ -210,7 +210,7 @@ public class TestSpringBootApplication30 extends AbstractIntegrationTest{ try { BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart') String output = result.getOutput() - assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration. Only one springBootApplication can be configured per Liberty server.")) + assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration file")) } catch (Exception e) { throw new AssertionError ("Fail on task deploy.", e) } @@ -221,7 +221,7 @@ public class TestSpringBootApplication30 extends AbstractIntegrationTest{ try { BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart') String output = result.getOutput() - assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration. Only one springBootApplication can be configured per Liberty server.")) + assertTrue(output.contains("SpringBootApplication elements are specified in multiple server configuration files")) } catch (Exception e) { throw new AssertionError ("Fail on task deploy.", e) } From b8b23f09f927d8ce99be9a5c48cbc939f827792e Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Fri, 10 Jan 2025 09:14:34 +0530 Subject: [PATCH 4/6] updating tests based on ci.common changes Signed-off-by: Arun Venmany --- .../openliberty/tools/gradle/TestSpringBootApplication30.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy index 9eb3177d..0e780d73 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy @@ -221,7 +221,7 @@ public class TestSpringBootApplication30 extends AbstractIntegrationTest{ try { BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart') String output = result.getOutput() - assertTrue(output.contains("SpringBootApplication elements are specified in multiple server configuration files")) + assertTrue(output.contains("Found multiple springBootApplication elements are specified in multiple server configuration files")) } catch (Exception e) { throw new AssertionError ("Fail on task deploy.", e) } From cfd6d07e57f82f6c632e06afb6b4024515bdcfee Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Fri, 10 Jan 2025 12:37:21 +0530 Subject: [PATCH 5/6] updating tests based on ci.common changes Signed-off-by: Arun Venmany --- .../openliberty/tools/gradle/TestSpringBootApplication30.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy index 0e780d73..7cde4470 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestSpringBootApplication30.groovy @@ -221,7 +221,7 @@ public class TestSpringBootApplication30 extends AbstractIntegrationTest{ try { BuildResult result = runTasksFailResult(buildDir, 'deploy', 'libertyStart') String output = result.getOutput() - assertTrue(output.contains("Found multiple springBootApplication elements are specified in multiple server configuration files")) + assertTrue(output.contains("Found multiple springBootApplication elements specified in the server configuration in files")) } catch (Exception e) { throw new AssertionError ("Fail on task deploy.", e) } From 7833806eb8c5323531c84fbb3ec9431cead8500f Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Mon, 13 Jan 2025 09:34:15 +0530 Subject: [PATCH 6/6] rolling back workflow yaml Signed-off-by: Arun Venmany --- .github/workflows/gradle.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6cfefe50..8e6c47d5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -39,9 +39,8 @@ jobs: - name: Checkout ci.common uses: actions/checkout@v3 with: - repository: arunvenmany-ibm/ci.common + repository: OpenLiberty/ci.common path: ci.common - ref: springboot_multi_node_fix - name: Checkout ci.ant uses: actions/checkout@v3 with: @@ -125,7 +124,7 @@ jobs: - name: Clone ci.ant, ci.common, ci.gradle repos to C drive run: | cp -r D:/a/ci.gradle/ci.gradle C:/ci.gradle - git clone https://github.com/arunvenmany-ibm/ci.common.git --branch springboot_multi_node_fix --single-branch C:/ci.common + git clone https://github.com/OpenLiberty/ci.common.git C:/ci.common git clone https://github.com/OpenLiberty/ci.ant.git C:/ci.ant # Cache mvn/gradle packages - name: Cache Maven packages