This is an automated email from the ASF dual-hosted git repository.

ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new b2dbbe6  Create separate sub-module for WAR build
b2dbbe6 is described below

commit b2dbbe66def48c943c4cf4feef9e35de74f5af1f
Author: Aleksandar Vidakovic <[email protected]>
AuthorDate: Sat Jan 1 22:05:38 2022 +0100

    Create separate sub-module for WAR build
---
 README.md                                    |  2 +-
 fineract-provider/build.gradle               | 32 +----------------------
 settings.gradle => fineract-war/build.gradle | 39 +++++++++++++++++++++++-----
 integration-tests/build.gradle               |  6 ++---
 oauth2-tests/build.gradle                    |  6 ++---
 settings.gradle                              |  1 +
 twofactor-tests/build.gradle                 |  6 ++---
 7 files changed, 44 insertions(+), 48 deletions(-)

diff --git a/README.md b/README.md
index 77b7833..872abfe 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 383cd1f..8c14d46 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/settings.gradle b/fineract-war/build.gradle
similarity index 50%
copy from settings.gradle
copy to fineract-war/build.gradle
index 69f7147..e45cbb5 100644
--- a/settings.gradle
+++ b/fineract-war/build.gradle
@@ -16,10 +16,35 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-rootProject.name='fineract'
-include ':fineract-provider'
-include ':integration-tests'
-include ':twofactor-tests'
-include ':oauth2-tests'
-include ':fineract-client'
-include ':fineract-doc'
+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 da6adba..9abc535 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 8c805db..f704877 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 69f7147..0a304eb 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 bddfd3d..aa91bb0 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 {

Reply via email to