- import groovy.json.JsonBuilder
- import groovy.json.JsonSlurper
- buildscript {
- ext.repos = {
- maven {
- url "${ARTIFACTORY_URL}/${PROXY_REPO_KEY}"
- credentials {
- username = "${ARTIFACTORY_USER}"
- password = "${ARTIFACTORY_PASSWORD}"
- }
- }
- }
- repositories repos
- }
- plugins {
- id 'java'
- id 'maven-publish'
- id 'war'
- id 'eclipse-wtp'
- id 'idea'
- }
- ext{
- if(project.hasProperty("os-build-deploy-profile")){
- if(project.hasProperty("CORE_VERSION")){
- dependencyVersion = project.getProperty("CORE_VERSION")
- println "CORE_VERSION is: "+dependencyVersion
- }
- else{
- throw new GradleException("CORE_VERSION not found neither from command line nor from gradle.properties")
- }
- }
- if(project.hasProperty("RELEASE_NAME")){
- releaseName = project.getProperty("RELEASE_NAME")
- println "RELEASE_NAME is: "+releaseName
- }
- else{
- throw new GradleException("RELEASE_NAME not found neither from command line nor from gradle.properties")
- }
- }
- group = 'com.oneshield.bundle.appserver'
- description = 'OsWeb'
- version = releaseName
- repositories repos
- configurations.runtimeOnly{
- if(project.hasProperty("os-build-deploy-profile")){
- exclude group:'org.glassfish.hk2.external', module:'aopalliance-repackaged'
- exclude group:'org.glassfish.hk2', module:'hk2-api'
- exclude group:'org.glassfish.hk2', module:'hk2-locator'
- exclude group:'org.glassfish.hk2', module:'hk2-utils'
- exclude group:'com.fasterxml.jackson.module', module:'jackson-module-jaxb-annotations'
- exclude group:'org.glassfish.hk2.external', module:'jakarta.inject'
- exclude group:'jakarta.ws.rs', module:'jakarta.ws.rs-api'
- exclude group:'org.javassist', module:'javassist'
- exclude group:'javax.annotation-api', module:'javax.annotation-api'
- exclude group:'org.glassfish.main.javaee-api', module:'javax.jws'
- exclude group:'javax.servlet.jsp', module:'javax.servlet.jsp-api'
- exclude group:'javax.xml.soap', module:'javax.xml.soap-api'
- exclude group:'javax.xml.ws', module:'jaxws-api'
- exclude group:'org.glassfish.jersey.core', module:'jersey-common'
- exclude group:'org.glassfish.jersey.ext', module:'jersey-entity-filtering'
- exclude group:'org.glassfish.jersey.inject', module:'jersey-hk2'
- exclude group:'org.glassfish.jersey.media', module:'jersey-media-json-jackson'
- exclude group:'org.glassfish.hk2', module:'osgi-resource-locator'
- exclude group:'com.io7m.xom', module:'xom'
- exclude group:'jakarta.activation', module:'jakarta.activation-api'
- exclude group:'jakarta.annotation', module:'jakarta.annotation-api'
- exclude group:'javax.activation', module:'javax.activation-api'
- exclude group:'javax.jms', module: 'javax.jms-api'
- exclude group: 'javax.transaction', module:'javax.transaction-api'
- exclude group: 'javax.mail', module:'mail'
- exclude group: 'junit', module:'junit'
- exclude group: 'com.h2database', module:'h2'
- exclude group: 'javax.ws.rs', module:'javax.ws.rs-api'
- exclude group: 'javax.ejb', module:'javax.ejb-api'
- exclude group: 'com.sun.codemodel', module:'codemodel'
- }
- // exclude group: 'xml-apis'
- // exclude group: 'org.w3c.dom', module: 'xerces'
- // exclude module: 'javaee-api'
- exclude group:'com.fasterxml.woodstox', module:'woodstox-core'
- exclude group:'org.apache.commons', module:'commons-collections4'
- exclude group:'org.apache.httpcomponents.client5', module:'httpclient5'
- exclude group:'org.apache.httpcomponents.core5', module:'httpcore5'
- exclude group:'commons-pool', module:'commons-pool'
- }
- dependencies {
- if(project.hasProperty("os-build-deploy-profile")){
- implementation "com.oneshield:BISchemaETL:$dependencyVersion"
- implementation "com.oneshield:OsAssignment:$dependencyVersion"
- implementation "com.oneshield:OsLib:$dependencyVersion"
- implementation "com.oneshield:OsDto:$dependencyVersion"
- implementation "com.oneshield:OsDao:$dependencyVersion"
- implementation "com.oneshield:OsCommon:$dependencyVersion"
- implementation "com.oneshield:OsObjectAccess:$dependencyVersion"
- implementation "com.oneshield:OrpCommon:$dependencyVersion"
- implementation "com.oneshield:OrpClient:$dependencyVersion"
- implementation "com.oneshield:OsAjaxFramework:$dependencyVersion"
- implementation "com.oneshield:OsBusinessLogic:$dependencyVersion"
- implementation "com.oneshield:CsBusinessLogic:$dependencyVersion"
- implementation "com.oneshield:OsCommand:$dependencyVersion"
- implementation "com.oneshield:OsMetadataObject:$dependencyVersion"
- implementation "com.oneshield:OsMetadata:$dependencyVersion"
- implementation "com.oneshield:OsServiceFramework:$dependencyVersion"
- implementation "com.oneshield:OsWorkflowService:$dependencyVersion"
- implementation "com.oneshield:OsEnterpriseAuthentication:$dependencyVersion"
- implementation "com.oneshield:OsNotifications:$dependencyVersion"
- implementation "com.oneshield:OrcService:$dependencyVersion"
- implementation "com.oneshield.microservice:mdserviceclient:$dependencyVersion"
- implementation "com.oneshield.microservice:swarmcommons:$dependencyVersion"
- implementation "com.oneshield:cdmsclient:$dependencyVersion"
- compileOnly "com.oneshield:OsDomainObject:$dependencyVersion"
- compileOnly "org.glassfish.hk2.external:aopalliance-repackaged:2.6.1"
- compileOnly "org.glassfish.hk2:hk2-api:2.6.1"
- compileOnly "org.glassfish.hk2:hk2-locator:2.6.1"
- compileOnly "org.glassfish.hk2:hk2-utils:2.6.1"
- compileOnly "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.13.4"
- compileOnly "org.glassfish.hk2.external:jakarta.inject:2.6.1"
- compileOnly "jakarta.ws.rs:jakarta.ws.rs-api:2.1.6"
- compileOnly "org.javassist:javassist:3.22.0-CR2"
- compileOnly "javax.annotation:javax.annotation-api:1.3.2"
- compileOnly "org.glassfish.main.javaee-api:javax.jws:3.1.2.2"
- compileOnly "javax.servlet.jsp:javax.servlet.jsp-api:2.3.3"
- compileOnly "javax.xml.soap:javax.xml.soap-api:1.4.0"
- compileOnly "javax.xml.ws:jaxws-api:2.3.1"
- compileOnly "org.glassfish.jersey.core:jersey-common:2.29.1"
- compileOnly "org.glassfish.jersey.ext:jersey-entity-filtering:2.29.1"
- compileOnly "org.glassfish.jersey.inject:jersey-hk2:2.29.1"
- compileOnly "org.glassfish.jersey.media:jersey-media-json-jackson:2.29.1"
- compileOnly "org.glassfish.hk2:osgi-resource-locator:1.0.3"
- compileOnly "com.io7m.xom:xom:1.2.10"
- compileOnly "jakarta.activation:jakarta.activation-api:1.2.1"
- compileOnly "jakarta.annotation:jakarta.annotation-api:1.3.5"
- compileOnly "javax.activation:javax.activation-api:1.2.0"
- compileOnly 'javax.jms:javax.jms-api:2.0.1'
- compileOnly "javax.ejb:javax.ejb-api:3.2.2"
- compileOnly "javax.transaction:javax.transaction-api:1.3"
- compileOnly "javax.mail:mail:1.4.7"
- compileOnly "junit:junit:4.12"
- compileOnly "com.h2database:h2:2.2.220"
- compileOnly "com.sun.codemodel:codemodel:2.6"
- compileOnly "javax.ws.rs:javax.ws.rs-api:2.1.1"
- implementation 'javax.activation:activation:1.1'
- implementation 'org.hamcrest:hamcrest-core:1.3'
- }
- else{
- implementation project(":OsLib")
- implementation project(":OsDto")
- implementation project(":OsDao")
- implementation project(":OsCommon")
- implementation project(":OsObjectAccess")
- implementation project(":OrpCommon")
- implementation project(":OrpClient")
- implementation project(":OsAjaxFramework")
- implementation project(":OsBusinessLogic")
- implementation project(":CsBusinessLogic")
- implementation project(":OsCommand")
- implementation project(":OsMetadataObject")
- implementation project(":OsMetadata")
- implementation project(":OsServiceFramework")
- implementation project(":OsWorkflowService")
- implementation project(":OsEnterpriseAuthentication")
- implementation project(":OsNotifications")
- implementation project(":BISchemaETL")
- implementation project(":OsAssignment")
- implementation project(":OrcService")
- implementation project(":mdserviceclient")
- implementation project(":swarmcommons")
- implementation project(":cdmsclient")
- compileOnly project(":OsDomainObject")
- }
- implementation 'org.apache.cxf:cxf-rt-frontend-jaxws:3.5.2'
- implementation 'javax.transaction:javax.transaction-api:1.3'
- implementation 'net.sf.json-lib:json-lib:2.3:jdk15'
- implementation 'org.apache.commons:commons-lang3:3.12.0'
- implementation 'commons-fileupload:commons-fileupload:1.5'
- implementation('org.apache.poi:poi-ooxml:5.2.2'){
- exclude group:'org.apache.commons', module:'commons-compress'
- }
- implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
- implementation 'xerces:xercesImpl:2.12.2'
- implementation 'ca.juliusdavies:not-yet-commons-ssl:0.3.17'
- compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
- compileOnly 'com.oracle.database.jdbc:ojdbc8:21.1.0.0'
- compileOnly 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.3'
- testImplementation 'junit:junit:4.12'
- }
- ext{
- senchaCliLocation = SENCHA_CLI_LOCATION
- senchaProfileTemp = SENCHA_BUILD_PROFILE
- customThemeLocation = System.env.CUSTOM_THEME_PATH
- if (!customThemeLocation?.trim()) {
- customThemeLocation = CUSTOM_THEME_PATH
- }
- customPackageLocation = System.env.CUSTOM_THEME_PACKAGES
- if (!customPackageLocation?.trim()) {
- customPackageLocation = CUSTOM_THEME_PACKAGES
- }
- customThemeCopy = System.env.CUSTOM_THEME_COPY
- if (!customThemeCopy?.trim()) {
- customThemeCopy = CUSTOM_THEME_COPY
- }
- customThemeAppJsonLocation = System.env.CUSTOM_THEME_APP_JSON_LOCATION
- if(!customThemeAppJsonLocation?.trim()){
- customThemeAppJsonLocation = CUSTOM_THEME_APP_JSON_LOCATION
- }
- senchaPath = "${senchaCliLocation}/sencha"
- senchaProfile = senchaProfileTemp
- isWindows = org.gradle.internal.os.OperatingSystem.current().windows
- }
- //not in use
- task senchaDownload {
- doLast {
- println 'If needed This task will download Sench CLI'
- println 'Download Location ' + SENCHA_CLI_LOCATION
- }
- }
- task copyCustomTheme {
- doLast {
- File directory = new File(customThemeLocation);
- if (directory.isDirectory() && customThemeCopy.toBoolean()) {
- String[] files = directory.list();
- if (files.length != 0) {
- println "Directory is not empty. Starting copy"
- println "Copying app.json"
- if(senchaProfile != "production"){
- copy {
- from ("src/main/webapp/OneShield/app.json")
- into("src/main/webapp/OneShield/")
- rename { String fileName ->
- fileName.replace('app.json', 'app_bkp.json')
- }
- }
- println "Copying Themes"
- copy {
- from(customThemeLocation) {
- include('**/*.*')
- }
- into("${projectDir}/${CUSTOM_THEME_PROJECT_LOCATION}")
- }
- println "Copying packages"
- copy {
- from(customPackageLocation) {
- include('**/*.*')
- }
- into("${projectDir}/${CUSTOM_THEME_PROJECT_LOCATION}")
- }
- copy {
- from ("${customThemeAppJsonLocation}/product_app_base.json")
- into("src/main/webapp/OneShield/")
- rename { String fileName ->
- fileName.replace('product_app_base.json', 'app.json')
- }
- }
- println "Copy of custom theme & packages completed"
- }
- }
- }
- }
- }
- task senchaFrontendBuild {
- dependsOn(copyCustomTheme)
- doLast {
- if(senchaProfile != "" && customThemeCopy.toBoolean()){
- println 'Sencha Path: ' + senchaPath
- println 'Sencha Profile: ' + senchaProfile
- println "Building for profile ${senchaProfile}"
- if(isWindows) {
- exec {
- workingDir webAppDir.toPath().toString() + '/OneShield'
- commandLine 'cmd', '/c', "${senchaPath}", 'app', 'build', senchaProfile
- }
- } else {
- exec {
- workingDir webAppDir.toPath().toString() + '/OneShield'
- commandLine "${senchaPath}", "app", "build", senchaProfile
- }
- }
- if(senchaProfile != "production"){
- copy {
- from ("src/main/webapp/OneShield/app_bkp.json")
- into("src/main/webapp/OneShield/")
- rename { String fileName ->
- fileName.replace('app_bkp.json', 'app.json')
- }
- }
- delete files("src/main/webapp/OneShield/app_bkp.json")
- if(isWindows) {
- exec {
- workingDir webAppDir.toPath().toString() + '/OneShield'
- commandLine 'cmd', '/c', "${senchaPath}", 'app', 'build', senchaProfile
- }
- } else {
- exec {
- workingDir webAppDir.toPath().toString() + '/OneShield'
- commandLine "${senchaPath}", "app", "build", senchaProfile
- }
- }
- }
- }
- }
- }
- tasks.withType(War) {
- duplicatesStrategy = DuplicatesStrategy.EXCLUDE
- }
- war {
- enabled = false
- }
- task warWithoutStaticContent(type: War, dependsOn: [classes]) {
- ext.runSenchaForStandardWar = { ->
- if(isWindows) {
- exec {
- workingDir "src/main/webapp/OneShield"
- commandLine 'cmd', '/c', "${senchaPath}", 'app', 'build', 'production'
- }
- }
- else {
- exec {
- workingDir "src/main/webapp/OneShield"
- commandLine "${senchaPath}", "app", "build", 'production'
- }
- }
- }
- copy {
- from ("src/main/webapp/OneShield/"){
- include(["dragon/", "tesl/", "*.jsp"])
- }
- into("src/main/webapp/")
- }
- archiveFileName = 'OsWebWithoutStaticContent.war'
- destinationDirectory = file("${projectDir}/dist/war")
- exclude('**/OneShield/**','**/**/*.json','**/**/*.jsonp','**/**/*.css','**/**/*.html','**/**/*.js','**/**/*.jpg','**/**/*.jpeg','**/**/*.png','**/**/*.gif')
- doLast{
- delete fileTree(dir: "src/main/webapp/", include: ["*.jsp"])
- def dirToRemove = ["src/main/webapp/dragon", "src/main/webapp/tesl"]
- dirToRemove.forEach{ dir ->
- delete "${projectDir}/${dir}"
- }
- runSenchaForStandardWar()
- }
- }
- task standardWar(type: War, dependsOn: [classes, warWithoutStaticContent]) {
- exclude('src/main/webapp/OneShield/ext/**')
- archiveFileName = 'OsWeb.war'
- destinationDirectory = file("${projectDir}/dist/war")
- }
- task createCopyOfStaticContent(type: Copy, dependsOn: [classes, standardWar]){
- from('src/main/webapp/')
- into("dist/war/oneshield/oneshield")
- exclude('WEB-INF/**','META-INF/**','OneShield/build/**','OneShield/ext/**')
- }
- task createZipOfStaticContent(type: Zip, dependsOn: createCopyOfStaticContent){
- from "${projectDir}/dist/war/oneshield/"
- exclude('oneshield/OneShield/ext/**')
- destinationDir = file("${projectDir}/dist/war/")
- archiveName = "oneshield.zip"
- doLast{
- delete fileTree(dir: "src/main/webapp/", include: ["*.jsp","*.jsonp","*.json","*.js"])
- def dirToRemove = ["dragon", "locale", "oscore", "oscoreflat", "oscoremob", "osthemeflat", "osthememob", "tesl", "thirdparty"]
- dirToRemove.forEach{ dir ->
- delete "${projectDir}/src/main/webapp/${dir}"
- }
- }
- }
- task createDists(dependsOn: [warWithoutStaticContent, standardWar, createZipOfStaticContent]) {
- println "Cleaning ${projectDir}/dist/war folder"
- delete "${projectDir}/dist/"
- }
- publishing {
- publications {
- OsWeb(MavenPublication) {
- groupId = group
- artifactId = "OsWeb"
- version = version
- artifact("${projectDir}/dist/war/OsWeb.war")
- }
- OsWebWithoutStaticContent(MavenPublication) {
- groupId = group
- artifactId = "OsWebWithoutStaticContent"
- version = version
- artifact("${projectDir}/dist/war/OsWebWithoutStaticContent.war")
- }
- oneshield(MavenPublication) {
- groupId = "com.oneshield.bundle.httpserver"
- artifactId = "oneshield"
- version = version
- artifact("${projectDir}/dist/war/oneshield.zip")
- }
- }
- repositories {
- maven {
- name 'nexus'
- url "${ARTIFACTORY_URL}/${REPO_KEY}"
- credentials {
- username "${ARTIFACTORY_USER}"
- password "${ARTIFACTORY_PASSWORD}"
- }
- }
- }
- }
- tasks.withType(JavaCompile) {
- options.encoding = 'UTF-8'
- }
[text] test
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: