Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for springbootappplication nodes in multiple config files #928

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ compileTestGroovy {
}

def libertyAntVersion = "1.9.16"
def libertyCommonVersion = "1.8.36"
def libertyCommonVersion = "1.8.37-SNAPSHOT"

dependencies {
implementation gradleApi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,18 @@ 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)
}
}

@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 in files"))
} catch (Exception e) {
throw new AssertionError ("Fail on task deploy.", e)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">

<featureManager>
<!-- tag::servlet[] -->
<feature>servlet-6.0</feature>
<!-- end::servlet[] -->
<!-- tag::springboot[] -->
<feature>springBoot-3.0</feature>
<!-- end::springboot[] -->
</featureManager>

<!-- tag::httpport[] -->
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" />
<!-- end::httpport[] -->
<include location="${server.config.dir}/included_server.xml"/>
<springBootApplication id="guide-spring-boot"
location="guide-spring-boot-0.1.0.jar"
name="guide-spring-boot" />

<!-- end::springBootApplication[] -->

</server>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<springBootApplication id="guide-spring-boot"
location="guide-spring-boot-0.2.0.jar"
name="guide-spring-boot" />
</server>
Original file line number Diff line number Diff line change
@@ -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")
}
}
Loading