@@ -28,18 +28,23 @@ buildscript {
2828 jcenter()
2929 }
3030
31- dependencies {
32- classpath ' com.palantir:jacoco-coverage:0.4.0'
33- classpath " com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2"
34- classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
35- }
31+ dependencies {
32+ classpath ' com.palantir:jacoco-coverage:0.4.0'
33+ classpath " com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2"
34+ classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
35+ }
3636}
3737
38- apply plugin : ' java'
39- apply plugin : ' maven'
40- apply plugin : ' com.palantir.jacoco-coverage'
41- apply plugin : ' maven-publish'
42- apply plugin : ' com.jfrog.bintray'
38+ allprojects {
39+ repositories {
40+ jcenter()
41+ }
42+ apply plugin : ' java'
43+ apply plugin : ' maven'
44+ apply plugin : ' maven-publish'
45+ apply plugin : ' com.palantir.jacoco-coverage'
46+ apply plugin : ' com.jfrog.bintray'
47+ }
4348
4449group = ' com.sybit'
4550version = getVersionName()
@@ -117,6 +122,7 @@ artifacts {
117122 archives sourcesJar, javadocJar
118123}
119124
125+ // task to send coverage data to Codacy
120126task sendCoverageToCodacy (type : JavaExec , dependsOn : jacocoTestReport) {
121127 main = " com.codacy.CodacyCoverageReporter"
122128 classpath = configurations. codacy
@@ -140,25 +146,39 @@ task integrationTest(type: Test) {
140146
141147publishing {
142148 publications {
143- mavenJava(MavenPublication ) {
149+
150+ MyPublication (MavenPublication ) {
151+ // we have to change scope from runtime to compile. Especially for Gson-lib.
152+ pom. withXml {
153+ asNode(). dependencies. ' *' . findAll() {
154+ it. scope. text() == ' runtime' && project. configurations. compile. allDependencies. find { dep ->
155+ dep. name == it. artifactId. text()
156+ }
157+ }. each { it. scope* . value = ' compile' }
158+ }
159+
144160 if (plugins. hasPlugin(' war' )) {
145161 from components. web
146162 } else {
147163 from components. java
148164 }
165+ groupId group
166+ artifactId rootProject. name
167+ version getVersionName()
149168
150169 artifact sourcesJar
151170 artifact javadocJar
152171 }
172+
153173 }
154174}
155175
156176bintray {
157177 user = project. hasProperty(' bintrayUser' ) ? project. property(' bintrayUser' ) : System . getenv(' BINTRAY_USER' )
158178 key = project. hasProperty(' bintrayApiKey' ) ? project. property(' bintrayApiKey' ) : System . getenv(' BINTRAY_API_KEY' )
159179
160- // publications = ['mavenJava ']
161- configurations = [' archives' ]
180+ publications = [' MyPublication ' ]
181+ // configurations = ['archives']
162182
163183 dryRun = false // Whether to run this as dry-run, without deploying
164184 publish = true // If version should be auto published after an upload
0 commit comments