Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- dependencies {
- classpath ("org.hidetake:gradle-ssh-plugin:2.8.0")
- }
- }
- plugins {
- id 'org.springframework.boot' version '2.1.4.RELEASE'
- id 'java'
- id 'eclipse-wtp'
- id "org.zeroturnaround.gradle.jrebel" version "1.1.8"
- }
- apply plugin: 'org.hidetake.ssh'
- apply plugin: 'io.spring.dependency-management'
- jar.dependsOn(generateRebel)
- compileJava {
- options.encoding = 'UTF-8' //used for it.********.utility.CharUtility.escapeHTML(String)
- }
- bootJar {
- launchScript()
- }
- springBoot {
- buildInfo {
- properties {
- artifact = '********'
- version = project.hasProperty('buildversion') ? buildversion: ''
- group = 'it.********'
- name = '********'
- additionalProperties = [
- operatingSystem: "${System.properties['os.name']} (${System.properties['os.version']})",
- //machine: InetAddress.localHost.hostName,
- ]
- }
- }
- }
- ext.jarPath = project.hasProperty('jarPath') ? "${projectDir}/${jarPath}" : "${buildDir}/libs/********.jar"
- ext.deployPath = project.hasProperty('deployPath') ? deployPath : '/opt/********'
- archivesBaseName = project.hasProperty('archives_base_name') ? archives_base_name : '********'
- sourceCompatibility = 8
- targetCompatibility = 8
- repositories {
- mavenCentral()
- maven {
- url "https://plugins.gradle.org/m2/"
- }
- }
- dependencies {
- // Framework - START
- implementation 'org.springframework.boot:spring-boot-starter'
- implementation('org.springframework.boot:spring-boot-starter-data-rest')
- implementation('org.springframework.boot:spring-boot-starter-jdbc')
- implementation('org.springframework.boot:spring-boot-starter-websocket')
- implementation('org.springframework.boot:spring-boot-starter-mustache')
- implementation('com.github.sps.mustache:mustache-spring-view:1.4')
- implementation('org.springframework.boot:spring-boot-starter-mail')
- implementation('org.springframework.boot:spring-boot-starter-web-services')
- implementation('org.springframework.boot:spring-boot-starter-security')
- implementation('org.springframework.security:spring-security-ldap')
- // required by LDAP
- implementation group: 'commons-pool', name: 'commons-pool', version: '1.6'
- // required by Logback for conditional processing
- implementation group: 'org.codehaus.janino', name: 'janino', version: '3.0.12'
- // Framework - END
- // DB - START
- implementation files('libs/ojdbc8.jar')
- implementation('org.sql2o:sql2o:1.6.0-RC3')
- implementation('org.sql2o.extensions:sql2o-oracle:1.6.0-RC3') {
- exclude group:'com.oracle'
- }
- // DB - END
- // Excel support - START
- implementation('org.apache.poi:poi:3.16')
- implementation('org.apache.poi:poi-ooxml:3.16') {
- exclude group:'stax', module: 'stax-api'
- }
- // Excel support - END
- // Cerved - START
- implementation files('libs/CervedObject.jar')
- implementation files('libs/CervedWebServices.jar')
- implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.2'
- implementation group: 'com.sun.istack', name: 'istack-commons-runtime', version: '3.0.8'
- // Cerved - END
- // START FLYING SAUCER
- implementation group: 'org.xhtmlrenderer', name: 'flying-saucer-pdf-openpdf', version: '9.1.18'
- implementation group: 'org.jsoup', name: 'jsoup', version: '1.11.3'
- // END FLYING SAUCER
- // START DSS
- implementation('org.digidoc4j.dss:dss-pades:5.2.d4j.3')
- implementation group: 'org.digidoc4j.dss', name: 'dss-service', version: '5.2.d4j.3'
- implementation group: 'org.digidoc4j.dss', name: 'dss-token', version: '5.2.d4j.3'
- implementation group: 'org.digidoc4j.dss', name: 'dss-utils-apache-commons', version: '5.2.d4j.3'
- // END DSS
- // START UNIT TEST 1
- testImplementation("org.springframework.boot:spring-boot-starter-test") {
- exclude group: 'junit', module: 'junit'
- }
- testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.2'
- testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.4.2'
- testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.2'
- testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.4.2'
- testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.4.2'
- // END UNIT TEST 1
- // MISCELLANEOUS - START
- implementation group: 'org.iban4j', name: 'iban4j', version: '3.2.1'
- implementation group: 'org.hibernate', name: 'hibernate-validator', version: '6.0.8.Final'
- implementation 'com.opencsv:opencsv:4.0'
- implementation group: 'org.unbescape', name: 'unbescape', version: '1.1.6.RELEASE'
- // MISCELLANEOUS - END
- /***** TOREMOVE - START *****/
- // iText 5 - START
- implementation('com.itextpdf:itextpdf:5.5.11')
- implementation('com.itextpdf.tool:xmlworker:5.5.11')
- // iText 5 - END
- implementation ('xerces:xercesImpl:2.6.2-jaxb-1.0.6') {
- exclude group:'xml-apis', module: 'xml-apis'
- }
- /***** TOREMOVE - END *****/
- }
- // START UNIT TEST 2
- test {
- useJUnitPlatform()
- }
- test.enabled = gradle.startParameter.taskNames.contains('test') || gradle.startParameter.taskNames.contains('check')
- // END UNIT TEST 2
- // Remote administration - START
- remotes {
- server {
- host = project.hasProperty('ip') ? ip : ''
- user = project.hasProperty('username') ? username : '********'
- password = project.hasProperty('pwd') ? pwd : '********'
- }
- }
- ssh.settings {
- logging = 'stdout'
- knownHosts = allowAnyHosts
- }
- task copyjar {
- doLast {
- if (!project.hasProperty('ip')){
- logger.lifecycle("No IP - Launch with -Pip=xxx.xxx.xxx.xxx");
- throw new StopExecutionException()
- }
- logger.lifecycle("Copying... <$jarPath to $deployPath>")
- ssh.run{
- session(remotes.server) {
- put from: jarPath, into: deployPath
- }
- }
- }
- }
- task stopServer {
- doLast {
- if (!project.hasProperty('ip')){
- logger.lifecycle("No IP - Launch with -Pip=xxx.xxx.xxx.xxx");
- throw new StopExecutionException()
- }
- logger.lifecycle("Execute stopServer on $remotes.server.host");
- if (project.hasProperty('cmd')){
- cmd = project.hasProperty('cmd') ? cmd : ''
- ssh.run {
- session(remotes.server) {
- execute cmd
- }
- }
- } else {
- ssh.run {
- session(remotes.server) {
- execute '/etc/init.d/******** stop'
- }
- }
- }
- }
- }
- task startServer{
- doLast {
- if (!project.hasProperty('ip')){
- logger.lifecycle("No IP - Launch with -Pip=xxx.xxx.xxx.xxx");
- throw new StopExecutionException()
- }
- logger.lifecycle("Execute stopServer on $remotes.server.host");
- if (project.hasProperty('cmd')){
- cmd = project.hasProperty('cmd') ? cmd : ''
- ssh.run {
- session(remotes.server) {
- execute cmd
- }
- }
- } else {
- ssh.run {
- session(remotes.server) {
- execute '/etc/init.d/******** start'
- }
- }
- }
- }
- }
- // Remote administration - STOP
- task copyBuildFiles(type: Copy) {
- from file("application.properties")
- into ("$buildDir/libs/")
- }
- build.dependsOn(copyBuildFiles)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement