Create separate sub-module for WAR build
This commit is contained in:
committed by
Petri Tuomola
parent
c91113b15a
commit
b2dbbe66de
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
rootProject.name='fineract'
|
||||
include ':fineract-provider'
|
||||
include ':fineract-war'
|
||||
include ':integration-tests'
|
||||
include ':twofactor-tests'
|
||||
include ':oauth2-tests'
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user