diff --git a/README.md b/README.md index 77b78339c..872abfe50 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The tenants database connection details are configured [via environment variable Instructions to build a WAR file ============ 1. Clone the repository or download and extract the archive file to your local directory. -2. Run `./gradlew clean war` to build a traditional WAR file which will be created at `build/libs` directory. +2. Run `./gradlew :fineract-war:clean :fineract-war:war` to build a traditional WAR file which will be created at `fineract-war/build/libs` directory. 3. Deploy this WAR to your Tomcat v9 Servlet Container. We recommend using the JAR instead of the WAR file deployment, because it's much easier. diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 383cd1f40..8c14d464e 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -20,7 +20,6 @@ description = 'Fineract Provider' apply plugin: 'org.zeroturnaround.gradle.jrebel' apply plugin: 'java' -apply plugin: 'war' apply plugin: 'eclipse' apply plugin: 'org.springframework.boot' apply plugin: 'openjpa' @@ -154,30 +153,6 @@ compileJava { finalizedBy resolve } -war { - from("$rootDir/licenses/") { - // notice the parens - into "WEB-INF/licenses/" // no leading slash - } - from("$rootDir/LICENSE_RELEASE") { - // notice the parens - into "WEB-INF/" // no leading slash - } - from("$rootDir/NOTICE_RELEASE") { - // notice the parens - into "WEB-INF/" // no leading slash - } - rename ('LICENSE_RELEASE', 'LICENSE') - rename ('NOTICE_RELEASE', 'NOTICE') - - from("$rootDir/DISCLAIMER") { - // notice the parens - into "WEB-INF/" // no leading slash - } - enabled = true - classifier = '' -} - // If we are running Gradle within Eclipse to enhance classes with OpenJPA, // set the classes directory to point to Eclipse's default build directory if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') @@ -271,10 +246,6 @@ bootJar { classifier = '' } -bootWar { - enabled = false -} - tasks.withType(Tar) { compression Compression.GZIP extension 'tar.gz' @@ -289,7 +260,7 @@ distributions { } contents { from bootJar - from war + // TODO: @vidakovic add war // TODO: @vidakovic add client library from("$rootDir/licenses/") { into "licenses/" @@ -374,6 +345,5 @@ processResources.dependsOn generateGitProperties checkstyleMain.dependsOn resolve checkstyleTest.dependsOn resolve licenseMain.dependsOn processResources, generateGitProperties -war.dependsOn resolve spotbugsTest.dependsOn resolve test.dependsOn resolve diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle new file mode 100644 index 000000000..e45cbb5be --- /dev/null +++ b/fineract-war/build.gradle @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +description = 'Fineract WAR' + +apply plugin: 'war' + +war { + archiveFileName = 'fineract-provider.war' + from("$rootDir/licenses/binary/") { + // notice the parens + into "WEB-INF/licenses/binary/" // no leading slash + } + from("$rootDir/LICENSE_RELEASE") { + // notice the parens + into "WEB-INF/" // no leading slash + } + from("$rootDir/NOTICE_RELEASE") { + // notice the parens + into "WEB-INF/" // no leading slash + } + rename ('LICENSE_RELEASE', 'LICENSE') + rename ('NOTICE_RELEASE', 'NOTICE') + + from("$rootDir/DISCLAIMER") { + // notice the parens + into "WEB-INF/" // no leading slash + } + enabled = true + classifier = '' +} + +dependencies { + implementation project(':fineract-provider') +} diff --git a/integration-tests/build.gradle b/integration-tests/build.gradle index da6adbaa9..9abc53518 100644 --- a/integration-tests/build.gradle +++ b/integration-tests/build.gradle @@ -33,7 +33,7 @@ cargo { // looks like Cargo doesn't detect the WAR file automatically in the multi-module setup deployable { - file = file("$rootDir/fineract-provider/build/libs/fineract-provider.war") + file = file("$rootDir/fineract-war/build/libs/fineract-provider.war") context = 'fineract-provider' } @@ -56,8 +56,8 @@ cargo { } } -cargoRunLocal.dependsOn ':fineract-provider:war' -cargoStartLocal.dependsOn ':fineract-provider:war' +cargoRunLocal.dependsOn ':fineract-war:war' +cargoStartLocal.dependsOn ':fineract-war:war' cargoStartLocal.mustRunAfter 'testClasses' test { diff --git a/oauth2-tests/build.gradle b/oauth2-tests/build.gradle index 8c805db4b..f704877b3 100644 --- a/oauth2-tests/build.gradle +++ b/oauth2-tests/build.gradle @@ -33,7 +33,7 @@ cargo { // looks like Cargo doesn't detect the WAR file automatically in the multi-module setup deployable { - file = file("$rootDir/fineract-provider/build/libs/fineract-provider.war") + file = file("$rootDir/fineract-war/build/libs/fineract-provider.war") context = 'fineract-provider' } @@ -57,8 +57,8 @@ cargo { } } -cargoRunLocal.dependsOn ':fineract-provider:war' -cargoStartLocal.dependsOn ':fineract-provider:war' +cargoRunLocal.dependsOn ':fineract-war:war' +cargoStartLocal.dependsOn ':fineract-war:war' cargoStartLocal.mustRunAfter 'testClasses' test { diff --git a/settings.gradle b/settings.gradle index 69f714751..0a304eb72 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,6 +18,7 @@ */ rootProject.name='fineract' include ':fineract-provider' +include ':fineract-war' include ':integration-tests' include ':twofactor-tests' include ':oauth2-tests' diff --git a/twofactor-tests/build.gradle b/twofactor-tests/build.gradle index bddfd3d8c..aa91bb01e 100644 --- a/twofactor-tests/build.gradle +++ b/twofactor-tests/build.gradle @@ -33,7 +33,7 @@ cargo { // looks like Cargo doesn't detect the WAR file automatically in the multi-module setup deployable { - file = file("$rootDir/fineract-provider/build/libs/fineract-provider.war") + file = file("$rootDir/fineract-war/build/libs/fineract-provider.war") context = 'fineract-provider' } @@ -57,8 +57,8 @@ cargo { } } -cargoRunLocal.dependsOn ':fineract-provider:war' -cargoStartLocal.dependsOn ':fineract-provider:war' +cargoRunLocal.dependsOn ':fineract-war:war' +cargoStartLocal.dependsOn ':fineract-war:war' cargoStartLocal.mustRunAfter 'testClasses' test {