diff --git a/browsermob-proxy/build.gradle b/browsermob-proxy/build.gradle index fe941781..d0f9a386 100644 --- a/browsermob-proxy/build.gradle +++ b/browsermob-proxy/build.gradle @@ -17,16 +17,12 @@ You should have received a copy of the GNU General Public License along with Wilma. If not, see . ===========================================================================*/ -//version = "2.0-beta-8-wilma-${wilmaVersion}.${buildId}" - used only at CI release job +ext.componentDescription = "BrowserMob Proxy - tuned for Wilma" -description = """BrowserMob Proxy for Wilma""" - -sourceCompatibility = 1.7 -targetCompatibility = 1.7 +apply from: '../common.gradle' repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots" } - maven { url "http://repo.maven.apache.org/maven2" } } dependencies { @@ -52,17 +48,19 @@ dependencies { jar { manifest.attributes( 'provider': 'gradle') - manifest.attributes( 'Implementation-Title': "$componentName-$version") + manifest.attributes( 'Implementation-Title': "$componentDescription - V$version") + archiveName = "$componentName-$version"+'.jar' } task copyJarToDistributions (type: Copy) { - from(rootProject.rootDir.absolutePath + '/browsermob-proxy/build/libs/') - into(rootProject.rootDir.absolutePath + '/browsermob-proxy/build/distributions') + dependsOn(sourceZip) + from("$buildDir/libs/") + into("$buildDir/distributions") } task createPom << { pom { - }.writeTo("$buildDir/distributions/browsermob-proxy-${version}.pom") + }.writeTo("$buildDir/distributions/$componentName-${version}.pom") } createPom.dependsOn(copyJarToDistributions) diff --git a/browsermob-proxy/gradle.properties b/browsermob-proxy/gradle.properties index 33265151..f4d82e1f 100644 --- a/browsermob-proxy/gradle.properties +++ b/browsermob-proxy/gradle.properties @@ -1,2 +1,2 @@ -componentName=browsermob-proxy +componentName=browsermob-proxy-2.0-beta-8-wilma buildNumber=DEV diff --git a/build.gradle b/build.gradle index 54fbf1fe..a1a94c32 100644 --- a/build.gradle +++ b/build.gradle @@ -18,51 +18,19 @@ along with Wilma. If not, see . ===========================================================================*/ apply plugin: "sonar-runner" -ext.myLocalRepository='file://C:/tmp/myRepo/' - -allprojects { - group = 'com.epam.wilma' - apply plugin: 'idea' - apply plugin: 'eclipse' - - version = "$wilmaVersion"+'.'+"$buildNumber" - - repositories { - jcenter() - } - -} - subprojects { - apply plugin: 'java' - apply plugin: 'maven' - apply plugin: 'maven-publish' - - sourceCompatibility = 1.7 - - task sourceZip(type: Zip) { - from 'src' - classifier 'sources' - extension 'jar' - } + apply from: new File(".").absolutePath + '/common.gradle' - publishing { - publications { - mavenJava(MavenPublication) { - from components.java - artifact sourceZip - pom.withXml { - asNode().appendNode('description', 'Wilma - Proxy and Service Stub') - } - } - } - } - subprojects { task allDeps(type: DependencyReportTask) {} } } +repositories { + jcenter() + maven { url "http://repo.maven.apache.org/maven2" } +} + sonarRunner { sonarProperties { property "sonar.host.url", "${sonar_host_url}" @@ -72,27 +40,3 @@ sonarRunner { property "sonar.jdbc.password", "${sonar_jdbc_password}" } } - -project(":browsermob-proxy") { - sonarRunner { - skipProject = true - } -} - -project(":wilma-functionaltest") { - sonarRunner { - skipProject = true - } -} - -project(":wilma-test-server") { - sonarRunner { - skipProject = true - } -} - -project(":wilma-test-client") { - sonarRunner { - skipProject = true - } -} \ No newline at end of file diff --git a/common.gradle b/common.gradle new file mode 100644 index 00000000..a16c9bee --- /dev/null +++ b/common.gradle @@ -0,0 +1,53 @@ +/*========================================================================== +Copyright 2015 EPAM Systems + +This file is part of Wilma. + +Wilma is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Wilma is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Wilma. If not, see . +===========================================================================*/ + +// Common local repository info +ext.myLocalRepository='file://C:/tmp/myRepo/' +ext.wilmaVersion=1.1 + +group = 'com.epam.wilma' +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'checkstyle' +apply plugin: 'java' +apply plugin: 'maven' + +version = "$wilmaVersion"+'.'+"$buildNumber" + +repositories { + jcenter() + maven { url "http://repo.maven.apache.org/maven2" } + maven { url "${myLocalRepository}" } +} + +// Source and target info +sourceCompatibility = 1.7 +targetCompatibility = 1.7 + +task sourceZip(type: Zip) { + from 'src' + baseName = "$componentName" + classifier 'sources' + extension 'jar' +} + +checkstyle.configFile = file(new File(".").absolutePath + "/config/checkstyle/checkstyle.xml") +checkstyle.configProperties = ['samedir' : new File(".").absolutePath + "/config/checkstyle"] +checkstyle.toolVersion = '5.6' +checkstyle.ignoreFailures = true diff --git a/gradle.properties b/gradle.properties index ed3b4964..a5cbd876 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ -wilmaVersion=1.1 buildNumber=DEV sonar_host_url=hosturl sonar_jdbc_username=userName sonar_jdbc_password=password +sonar_jdbc_url=jdbcurl diff --git a/settings.gradle b/settings.gradle index 6fbe8968..8c60127a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,8 +10,6 @@ */ rootProject.name = 'wilma' -include 'wilma-functionaltest' -include 'browsermob-proxy' include 'wilma-message-search' include 'wilma-message-search:wilma-message-search-lucene' include 'wilma-message-search:wilma-message-search-webapp' @@ -47,13 +45,3 @@ include 'wilma-application:wilma-message-sequence' for (subproject in (project(':wilma-application')).children){ subproject.projectDir = file("$rootDir/wilma-application/modules/$subproject.name") } - -include 'wilma-test-server' -include 'wilma-test-client' - -project(':wilma-test-server').projectDir = file("$rootDir/wilma-test/wilma-test-server") -project(':wilma-test-client').projectDir = file("$rootDir/wilma-test/wilma-test-client") - -include 'wilma-mock' - -project(':wilma-mock').projectDir = file("$rootDir/wilma-mock") \ No newline at end of file diff --git a/wilma-application/build.gradle b/wilma-application/build.gradle index 930d7ca3..84d9975b 100644 --- a/wilma-application/build.gradle +++ b/wilma-application/build.gradle @@ -20,10 +20,7 @@ along with Wilma. If not, see . description = 'wilma application' allprojects { - apply plugin: 'checkstyle' apply plugin: 'jacoco' - group = 'com.epam.wilma' - version = "$wilmaVersion" } ext.javaxServletApi='javax.servlet:javax.servlet-api:3.1.0' @@ -124,11 +121,8 @@ task release(type: Zip) { } subprojects { - sourceCompatibility = 1.7 - targetCompatibility = 1.7 - + repositories { - maven { url "http://repo.maven.apache.org/maven2" } maven { url "https://repository.jboss.org/nexus/content/groups/public" } } diff --git a/wilma-application/modules/wilma-safeguard/src/main/java/com/epam/wilma/safeguard/monitor/JmsQueueMonitorTask.java b/wilma-application/modules/wilma-safeguard/src/main/java/com/epam/wilma/safeguard/monitor/JmsQueueMonitorTask.java index aad1d3a0..ebb8f832 100644 --- a/wilma-application/modules/wilma-safeguard/src/main/java/com/epam/wilma/safeguard/monitor/JmsQueueMonitorTask.java +++ b/wilma-application/modules/wilma-safeguard/src/main/java/com/epam/wilma/safeguard/monitor/JmsQueueMonitorTask.java @@ -93,7 +93,7 @@ public void run() { private void resetDlqAsNecessary() { boolean sizeIsValid = false; - Long dlqSize = new Long(0); + Long dlqSize = Long.valueOf(0); try { dlqSize = (Long) mBeanServerConnection.getAttribute(dlqQueue, "QueueSize"); sizeIsValid = true; @@ -110,14 +110,6 @@ private void resetDlqAsNecessary() { } } - public boolean isSafeguardFIEnabled() { - return fIDecompressionEnabled; - } - - public boolean isSafeguardMWEnabled() { - return messageWritingEnabled; - } - private void getSafeguardLimits() { if (safeguardLimits == null) { PropertyDTO properties = configurationAccess.getProperties(); diff --git a/wilma-functionaltest/build.gradle b/wilma-functionaltest/build.gradle index e654700d..2756af7a 100644 --- a/wilma-functionaltest/build.gradle +++ b/wilma-functionaltest/build.gradle @@ -17,11 +17,7 @@ along with Wilma. If not, see . ===========================================================================*/ apply plugin: 'application' -apply plugin: 'checkstyle' - -repositories { - maven { url "${myLocalRepository}" } -} +apply from: '../common.gradle' dependencies { compile "com.epam.gepard:gepard-core:4.0.35" @@ -33,11 +29,6 @@ dependencies { compile "com.epam.wilma:wilma-mock:$version" } -checkstyle.configFile = file("$rootProject.rootDir/config/checkstyle/checkstyle.xml") -checkstyle.configProperties = ['samedir' : "$rootProject.rootDir/config/checkstyle"] -checkstyle.toolVersion = '5.6' -checkstyle.ignoreFailures = true - mainClassName = "com.epam.gepard.AllTestRunner" def appArgs = ["$buildDir/resources/main/wilma-test.properties,$buildDir/resources/main/gepard.properties"] diff --git a/wilma-functionaltest/gradle.properties b/wilma-functionaltest/gradle.properties new file mode 100644 index 00000000..1dc27a62 --- /dev/null +++ b/wilma-functionaltest/gradle.properties @@ -0,0 +1,2 @@ +componentName=wilma-functionaltest +buildNumber=DEV diff --git a/wilma-message-search/build.gradle b/wilma-message-search/build.gradle index c8cbab8c..44a78c44 100644 --- a/wilma-message-search/build.gradle +++ b/wilma-message-search/build.gradle @@ -21,10 +21,7 @@ description= 'wilma-message-search' allprojects { - apply plugin: 'checkstyle' apply plugin: 'jacoco' - group = 'com.epam.wilma.message.search' - version = "$wilmaVersion" } task docs(type: Javadoc) { @@ -107,11 +104,7 @@ task release(type: Zip) { subprojects { - sourceCompatibility = 1.7 - targetCompatibility = 1.7 - repositories { - maven { url "http://repo.maven.apache.org/maven2" } maven { url "https://repository.jboss.org/nexus/content/groups/public" } } diff --git a/wilma-message-search/gradle.properties b/wilma-message-search/gradle.properties index 0dfc5c4d..3d225656 100644 --- a/wilma-message-search/gradle.properties +++ b/wilma-message-search/gradle.properties @@ -1,3 +1,2 @@ componentName=Wilma-MessageSearch -buildNumber=DEV -org.gradle.daemon=true \ No newline at end of file +buildNumber=DEV \ No newline at end of file diff --git a/wilma-mock/build.gradle b/wilma-mock/build.gradle index 712b61a3..cb2af724 100644 --- a/wilma-mock/build.gradle +++ b/wilma-mock/build.gradle @@ -17,27 +17,23 @@ You should have received a copy of the GNU General Public License along with Wilma. If not, see . ===========================================================================*/ -description = "wilma-mock" +ext.componentDescription = "Wilma-Mock" +apply plugin: 'maven-publish' apply plugin: 'application' -apply plugin: 'checkstyle' apply plugin: 'jacoco' - -sourceCompatibility = 1.7 -targetCompatibility = 1.7 +apply plugin: "sonar-runner" +apply from: '../common.gradle' mainClassName = 'com.epam.wilma.mock.client.WilmaMock' jar { manifest.attributes( 'provider': 'gradle') manifest.attributes( 'Main-Class': mainClassName) - manifest.attributes( 'Implementation-Title': "$componentName-v$version") + manifest.attributes( 'Implementation-Title': "$componentDescription - V$version") archiveName = "$componentName-$version"+'.jar' } -repositories { - maven { url "http://repo.maven.apache.org/maven2" } -} dependencies { compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.5' compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.0.12' @@ -50,11 +46,6 @@ dependencies { testCompile group: 'org.testng', name: 'testng', version:'6.8.5' } -checkstyle.configFile = file("$rootProject.rootDir/config/checkstyle/checkstyle.xml") -checkstyle.configProperties = ['samedir' : "$rootProject.rootDir/config/checkstyle"] -checkstyle.toolVersion = '5.6' -checkstyle.ignoreFailures = true - test.useTestNG() configurations { @@ -88,15 +79,28 @@ task jacocoReport(type: JacocoReport) { } } + task copyJarToDistributions (type: Copy) { dependsOn(sourceZip) - from(rootProject.rootDir.absolutePath + '/wilma-mock/build/libs/') - into(rootProject.rootDir.absolutePath + '/wilma-mock/build/distributions') + from("$buildDir/libs/") + into("$buildDir/distributions") +} + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourceZip + pom.withXml { + asNode().appendNode('description', 'Wilma - Mock Service Library') + } + } + } } task createPom << { pom { - }.writeTo("$buildDir/distributions/wlima-mock-$version"+'.pom') + }.writeTo("$buildDir/distributions/$componentName-${version}.pom") } createPom.dependsOn(copyJarToDistributions) @@ -106,4 +110,14 @@ uploadArchives { repository(url: "${myLocalRepository}") } } -} \ No newline at end of file +} + +sonarRunner { + sonarProperties { + property "sonar.host.url", "${sonar_host_url}" + property "sonar.jdbc.url", "${sonar_jdbc_url}" + property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver" + property "sonar.jdbc.username", "${sonar_jdbc_username}" + property "sonar.jdbc.password", "${sonar_jdbc_password}" + } +} diff --git a/wilma-mock/gradle.properties b/wilma-mock/gradle.properties index 4ee3add1..430940e4 100644 --- a/wilma-mock/gradle.properties +++ b/wilma-mock/gradle.properties @@ -1,2 +1,7 @@ componentName=wilma-mock -buildNumber=DEV \ No newline at end of file +buildNumber=DEV + +sonar_host_url=hosturl +sonar_jdbc_username=userName +sonar_jdbc_password=password +sonar_jdbc_url=jdbcurl diff --git a/wilma-test/wilma-test-client/build.gradle b/wilma-test/wilma-test-client/build.gradle index da0baf44..8412f658 100644 --- a/wilma-test/wilma-test-client/build.gradle +++ b/wilma-test/wilma-test-client/build.gradle @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with Wilma. If not, see . ===========================================================================*/ -description = "Wilma Test Client" +ext.componentDescription = "Wilma Test Client" buildscript { repositories { jcenter() } @@ -26,16 +26,9 @@ buildscript { } } -apply plugin: 'java' -apply plugin: 'maven' -apply plugin: 'application' apply plugin: 'com.github.johnrengelman.shadow' - -group = 'com.epam.wilma' -version = "$wilmaVersion" - -sourceCompatibility = 1.7 -targetCompatibility = 1.7 +apply plugin: 'application' +apply from: '../../common.gradle' mainClassName = 'com.epam.wilma.test.client.WilmaTestClientApplication' @@ -46,20 +39,18 @@ shadowJar { 'META-INF/*.RSA' ] - archiveName = "wilma-test-client-$version.$buildNumber"+'.jar' + archiveName = "$componentName-$version"+'.jar' } jar { manifest.attributes( 'provider': 'gradle') manifest.attributes( 'Main-Class': mainClassName) - manifest.attributes( 'Implementation-Title': "$componentName-v$version"+'.'+"$buildNumber") - - finalizedBy shadowJar -} + manifest.attributes( 'Implementation-Title': "$componentDescription - V$version") + archiveName = "$componentName-$version"+'.jar' -repositories { - maven { url "http://repo.maven.apache.org/maven2" } + finalizedBy shadowJar } + dependencies { compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.5' compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.0.12' diff --git a/wilma-test/wilma-test-client/gradle.properties b/wilma-test/wilma-test-client/gradle.properties index 2568dca3..92d088e2 100644 --- a/wilma-test/wilma-test-client/gradle.properties +++ b/wilma-test/wilma-test-client/gradle.properties @@ -1,2 +1,2 @@ -componentName=Wilma Test Client +componentName=wilma-test-client buildNumber=DEV diff --git a/wilma-test/wilma-test-server/build.gradle b/wilma-test/wilma-test-server/build.gradle index 5bb39450..671ce593 100644 --- a/wilma-test/wilma-test-server/build.gradle +++ b/wilma-test/wilma-test-server/build.gradle @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with Wilma. If not, see . ===========================================================================*/ -description = "wilma test server" +ext.componentDescription = "Wilma Test Server" buildscript { repositories { jcenter() } @@ -26,16 +26,9 @@ buildscript { } } -apply plugin: 'java' -apply plugin: 'maven' -apply plugin: 'application' apply plugin: 'com.github.johnrengelman.shadow' - -group = 'com.epam.wilma' -version = "$wilmaVersion" - -sourceCompatibility = 1.7 -targetCompatibility = 1.7 +apply plugin: 'application' +apply from: '../../common.gradle' mainClassName = 'com.epam.wilma.test.server.WilmaTestServerApplication' @@ -46,20 +39,18 @@ shadowJar { 'META-INF/*.RSA' ] - archiveName = "wilma-test-server-$version.$buildNumber"+'.jar' + archiveName = "$componentName-$version"+'.jar' } jar { manifest.attributes( 'provider': 'gradle') manifest.attributes( 'Main-Class': mainClassName) - manifest.attributes( 'Implementation-Title': "$componentName-v$version"+'.'+"$buildNumber") - - finalizedBy shadowJar -} + manifest.attributes( 'Implementation-Title': "$componentDescription - V$version") + archiveName = "$componentName-$version"+'.jar' -repositories { - maven { url "http://repo.maven.apache.org/maven2" } + finalizedBy shadowJar } + dependencies { compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.5' compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.0.12' diff --git a/wilma-test/wilma-test-server/gradle.properties b/wilma-test/wilma-test-server/gradle.properties index f7c514da..0264e7cf 100644 --- a/wilma-test/wilma-test-server/gradle.properties +++ b/wilma-test/wilma-test-server/gradle.properties @@ -1,2 +1,2 @@ -componentName=Wilma Test Server +componentName=wilma-test-server buildNumber=DEV