-
Notifications
You must be signed in to change notification settings - Fork 47
Description
I have a multiple Struts war project ear application running on Open Liberty.
Using the bootstrap.properties file , I am passing 2 name/value pairs containing the region
and left Nav xml name to load,
I started Liberty using LibertyDev and the config.jar that contains the config xml files would not load.
I changed looseApplication=false instead of true and my config,jar loaded and my valudations completed.
I have a sample project , but its too large to post here.
// tag::ear[]
apply plugin: 'ear'
// end::ear[]
// tag::liberty[]
apply plugin: 'liberty'
// end::liberty[]
description = 'EAR Module'
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'Sonatype Nexus Snapshots'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
flatDir { dirs 'libs' }
}
dependencies {
classpath 'io.openliberty.tools:liberty-gradle-plugin:3.9.3'
}
}
dependencies {
// tag::war[]
//implementation fileTree(dir: 'libs', include: ['*.jar'])
deploy project(path:':appshell', configuration:'archives')
deploy project(path:':security', configuration:'archives')
earlib project(':app')
earlib project(':config')
earlib project(':reportresources')
//earlib 'libs/mojo-sources.jar'
// end::war[]
}
// tag::earConfig[]
ear {
archiveFileName = rootProject.name + '-' + getArchiveBaseName().get() + '-' +
rootProject.version + '.' + getArchiveExtension().get()
deploymentDescriptor {
// tag::webModule[]
webModule ('guide-gradle-jims3-war-1.0-SNAPSHOT.war', '/converter')
webModule ('guide-gradle-jims3-appshell-1.0-SNAPSHOT', '/appshell')
webModule ('guide-gradle-jims3-security-1.0-SNAPSHOT', '/security.war')
// end::webModule[]
}
}
// end::earConfig[]
// tag::libertyConfig[]
liberty {
server {
// tag::sampleLibertyServer[]
name = 'sampleLibertyServer'
// end::sampleLibertyServer[]
/* bootstrapProperties = [
'mojo.config': 'WASJPT.xml',
'LeftNav': 'UVLeftNav.xml' // Example: dynamically setting app location
//'myCustomProperty': 'myValue' // Example: a custom property
]*/
deploy {
apps = [ear]
// tag::copyLibsDirectory[]
copyLibsDirectory = file("${project.getLayout().getBuildDirectory().getAsFile().get()}/libs")
// end::copyLibsDirectory[]
}
//bootstrapPropertiesFile = file('src/main/liberty/config/bootstrap.properties')
// tag::httpPort[]
var.'http.port' = '9080'
// end::httpPort[]
var.'https.port' = '9443'
//var. 'mojo.config' = 'WASJPT.xml'
//var. 'LeftNav' = 'JUVLeftNav.xml'
verifyAppStartTimeout = 30
looseApplication = true
}
}
// end::libertyConfig[]
// tag::test[]
test {
systemProperty 'http.port', liberty.server.var.'http.port'
enabled = gradle.startParameter.taskNames.contains('test')
}
// end::test[]
// tag::deployDependsOn[]
deploy.dependsOn 'ear'
// end::deployDependsOn[]
// tag::earDependsOn[]
ear.dependsOn ':jar:jar', ':war:war',':appshell:war',':app:jar',':config:jar'
// end::earDependsOn[]