|
1 | 1 | buildscript { |
2 | | - ext { |
3 | | - springBootVersion = '1.5.1.RELEASE' |
4 | | - } |
5 | | - repositories { |
6 | | - mavenCentral() |
7 | | - jcenter() |
8 | | - |
9 | | - |
10 | | - } |
11 | | - dependencies { |
12 | | - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") |
13 | | - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1" |
14 | | - |
15 | | - } |
| 2 | + ext { |
| 3 | + springBootVersion = '1.5.1.RELEASE' |
| 4 | + } |
| 5 | + repositories { |
| 6 | + mavenCentral() |
| 7 | + jcenter() |
| 8 | + } |
| 9 | + dependencies { |
| 10 | + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1' |
| 11 | + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") |
| 12 | + } |
16 | 13 | } |
17 | 14 |
|
18 | 15 | apply plugin: 'java' |
19 | 16 | apply plugin: 'eclipse' |
20 | 17 | apply plugin: 'maven-publish' |
21 | 18 | apply plugin: 'maven' |
22 | | -apply plugin: 'jacoco' |
| 19 | +apply plugin: 'com.jfrog.bintray' |
| 20 | + |
23 | 21 |
|
24 | 22 | group 'io.devxchange' |
25 | | -version '0.0.2-SNAPSHOT' |
| 23 | +version '1.0.0' |
26 | 24 | archivesBaseName = "logmetrics" |
27 | 25 |
|
28 | 26 |
|
29 | 27 | sourceCompatibility = 1.8 |
30 | 28 |
|
31 | 29 | repositories { |
32 | | - mavenCentral() |
33 | | - maven { url "https://repo.spring.io/snapshot" } |
34 | | - maven { url "https://repo.spring.io/milestone" } |
| 30 | + mavenCentral() |
| 31 | + maven { url "https://repo.spring.io/snapshot" } |
| 32 | + maven { url "https://repo.spring.io/milestone" } |
35 | 33 | } |
36 | 34 |
|
37 | 35 |
|
38 | 36 | dependencies { |
39 | | - compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.2.RELEASE' |
| 37 | + compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.2.RELEASE' |
40 | 38 | compile("javax.servlet:javax.servlet-api:3.1.0") |
41 | | - compile group: 'commons-io', name: 'commons-io', version: '2.4' |
| 39 | + compile group: 'commons-io', name: 'commons-io', version: '2.4' |
42 | 40 | compile("com.google.code.gson:gson:2.3.1") |
43 | 41 | compile("com.jayway.jsonpath:json-path:2.0.0") |
44 | | - compile group: 'commons-codec', name: 'commons-codec', version: '1.10' |
| 42 | + compile group: 'commons-codec', name: 'commons-codec', version: '1.10' |
45 | 43 | compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1' |
46 | | - compile group: 'commons-collections', name: 'commons-collections', version: '3.0' |
47 | | - compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.4' |
48 | | - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.4' |
| 44 | + compile group: 'commons-collections', name: 'commons-collections', version: '3.0' |
| 45 | + compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.4' |
| 46 | + compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.4' |
49 | 47 |
|
50 | 48 | } |
51 | 49 |
|
52 | | -task javadocJar(type: Jar) { |
53 | | - classifier = 'javadoc' |
54 | | - from javadoc |
55 | | -} |
56 | | - |
57 | | -task sourcesJar(type: Jar) { |
| 50 | +// custom tasks for creating source/javadoc jars |
| 51 | +task sourcesJar(type: Jar, dependsOn: classes) { |
58 | 52 | classifier = 'sources' |
59 | 53 | from sourceSets.main.allSource |
60 | 54 | } |
61 | 55 |
|
62 | | -jacocoTestReport { |
63 | | - reports { |
64 | | - xml.enabled true |
65 | | - html.enabled false |
66 | | - } |
| 56 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
| 57 | + classifier = 'javadoc' |
| 58 | + from javadoc.destinationDir |
67 | 59 | } |
68 | 60 |
|
69 | | -check.dependsOn jacocoTestReport |
70 | | - |
71 | 61 | artifacts { |
72 | | - archives javadocJar, sourcesJar |
| 62 | + archives sourcesJar, javadocJar |
73 | 63 | } |
74 | 64 |
|
75 | 65 | publishing { |
76 | | - publications { |
77 | | - mavenJava(MavenPublication) { |
78 | | - from components.java |
79 | | - } |
80 | | - } |
81 | | - |
82 | | - repositories { |
83 | | - mavenLocal() |
84 | | - |
85 | | - maven { |
86 | | - credentials { |
87 | | - username "$ossrhUsername" |
88 | | - password "$ossrhPassword" |
89 | | - } |
90 | | - |
91 | | - if(project.version.endsWith('-SNAPSHOT')) { |
92 | | - url "https://oss.sonatype.org/content/repositories/snapshots" |
93 | | - } else { |
94 | | - url "https://oss.sonatype.org/service/local/staging/deploy/maven2" |
95 | | - } |
96 | | - } |
97 | | - } |
| 66 | + publications { |
| 67 | + MyPublication(MavenPublication) { |
| 68 | + from components.java |
| 69 | + groupId 'io.devxchange' |
| 70 | + artifactId 'logmetrics' |
| 71 | + version '1.0.0' |
| 72 | + } |
| 73 | + } |
98 | 74 | } |
99 | 75 |
|
100 | | - |
| 76 | +bintray { |
| 77 | + user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') |
| 78 | + key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') |
| 79 | + publications = ['MyPublicaiton'] |
| 80 | + dryRun = false |
| 81 | + publish = true |
| 82 | + pkg { |
| 83 | + repo = 'logmetrics' |
| 84 | + name = 'logmetrics-java' |
| 85 | + userOrg = 'devxchange' |
| 86 | + licenses = ['Apache-2.0'] |
| 87 | + vcsUrl = 'https://github.com/devxchangeio/logmetrics-java.git' |
| 88 | + labels = ['devxchangeio', 'logmetrics'] |
| 89 | + publicDownloadNumbers = true |
| 90 | + attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes |
| 91 | + version { |
| 92 | + name = '1.0.0-Final' |
| 93 | + desc = 'LogMetrics for Java Projects 1.0 final' |
| 94 | + } |
| 95 | + } |
| 96 | +} |
0 commit comments