forked from jfrog/artifactory-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
129 lines (113 loc) · 4.14 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import static java.lang.System.getenv
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4+')
}
}
allprojects {
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
group = 'org.jfrog.artifactory.client'
version = currentVersion
status = version.endsWith('-SNAPSHOT') ? 'integration' : 'release'
project.tasks.withType(Jar).each {
it.version = currentVersion
}
}
artifactoryPublish.skip = true
artifactory {
contextUrl = 'https://oss.jfrog.org'
resolve {
repository {
repoKey = 'libs-release'
}
}
publish {
defaults {
publications 'main'
}
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
final env = getenv()
dependencies {
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile group: 'commons-lang', name: 'commons-lang', version: '2.3'
compile 'com.fasterxml.jackson.core:jackson-core:2.9.5'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.6'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar,
javadocJar,
jar
}
test {
useTestNG()
testLogging {
exceptionFormat "full"
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
minGranularity 0
}
ignoreFailures = System.getenv("IGNORE_FAILURES") ? System.getenv("IGNORE_FAILURES").toBoolean() : false
}
publishing {
publications {
main(MavenPublication) {
from components.java
artifact sourcesJar
//artifact javadocJar
pom.withXml {
asNode().with {
appendNode('packaging', 'jar')
appendNode('name', 'artifactory-java-client')
appendNode('description', 'Java client for working with Artifactory')
appendNode('url', 'https://github.com/JFrogDev/artifactory-client-java')
appendNode('licenses').with {
appendNode('license').with {
appendNode('name', 'The Apache Software License, Version 2.0')
appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0')
}
}
appendNode('developers').with {
appendNode('developer').with {
appendNode('id', 'jbaruch')
appendNode('name', 'Baruch Sadogursky')
appendNode('email', '[email protected]')
}
}
appendNode('scm').with {
appendNode('connection', '[email protected]:JFrogDev/artifactory-client-java.git')
appendNode('developerConnection', '[email protected]:JFrogDev/artifactory-client-java.git')
appendNode('url', 'https://github.com/JFrogDev/artifactory-client-java')
}
}
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
}