forked from testcontainers/testcontainers-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublishing.gradle
79 lines (69 loc) · 3.02 KB
/
publishing.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
apply plugin: 'maven-publish'
task sourceJar(type: Jar) {
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc
}
publishing {
publications {
mavenJava(MavenPublication) { publication ->
artifactId = project.name
artifact project.tasks.jar
artifact sourceJar
artifact javadocJar
pom.withXml {
def rootNode = asNode()
rootNode.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name project.description
description 'Isolated container management for Java code testing'
url 'https://testcontainers.org'
issueManagement {
system 'GitHub'
url 'https://github.com/testcontainers/testcontainers-java/issues'
}
licenses {
license {
name 'MIT'
url 'http://opensource.org/licenses/MIT'
}
}
scm {
url 'https://github.com/testcontainers/testcontainers-java/'
connection 'scm:git:git://github.com/testcontainers/testcontainers-java.git'
developerConnection 'scm:git:ssh://[email protected]/testcontainers/testcontainers-java.git'
}
developers {
developer {
id 'rnorth'
name 'Richard North'
email '[email protected]'
}
}
}
def dependenciesNode = rootNode.appendNode('dependencies')
def addDependency = { dependency, scope ->
dependenciesNode.appendNode('dependency').with {
appendNode('groupId', dependency.group)
appendNode('artifactId', dependency.name)
appendNode('version', dependency.version)
appendNode('scope', scope)
if (dependency instanceof ModuleDependency && !dependency.excludeRules.empty) {
def excludesNode = appendNode('exclusions')
for (rule in dependency.excludeRules) {
excludesNode.appendNode('exclusion').with {
appendNode('groupId', rule.group)
appendNode('artifactId', rule.module)
}
}
}
}
}
project.configurations.compile.dependencies.each { addDependency(it, 'compile') }
project.configurations.provided.dependencies.each { addDependency(it, 'provided') }
}
}
}
}