1
- apply plugin : ' maven'
1
+ apply plugin : ' maven-publish '
2
2
apply plugin : ' signing'
3
3
4
4
def isReleaseBuild () {
@@ -24,53 +24,59 @@ def getRepositoryPassword() {
24
24
}
25
25
26
26
afterEvaluate { project ->
27
- uploadArchives {
28
- repositories {
29
- mavenDeployer {
30
- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
27
+ publishing {
28
+ publications {
29
+ mavenJava(MavenPublication ) {
31
30
32
- pom . groupId = GROUP
33
- pom . artifactId = POM_ARTIFACT_ID
34
- pom . version = VERSION_NAME
31
+ groupId = GROUP
32
+ artifactId = POM_ARTIFACT_ID
33
+ version = VERSION_NAME
35
34
36
- repository(url : getReleaseRepositoryUrl()) {
37
- authentication(userName : getRepositoryUsername(), password : getRepositoryPassword())
38
- }
39
- snapshotRepository(url : getSnapshotRepositoryUrl()) {
40
- authentication(userName : getRepositoryUsername(), password : getRepositoryPassword())
41
- }
42
-
43
- pom. project {
44
- name POM_NAME
45
- packaging POM_PACKAGING
46
- description POM_DESCRIPTION
47
- url POM_URL
35
+ pom {
36
+ name = POM_NAME
37
+ packaging = POM_PACKAGING
38
+ description = POM_DESCRIPTION
39
+ url = POM_URL
48
40
49
41
scm {
50
- url POM_SCM_URL
51
- connection POM_SCM_CONNECTION
52
- developerConnection POM_SCM_DEV_CONNECTION
42
+ url = POM_SCM_URL
43
+ connection = POM_SCM_CONNECTION
44
+ developerConnection = POM_SCM_DEV_CONNECTION
53
45
}
54
46
55
47
licenses {
56
48
license {
57
- name POM_LICENCE_NAME
58
- url POM_LICENCE_URL
59
- distribution POM_LICENCE_DIST
49
+ name = POM_LICENCE_NAME
50
+ url = POM_LICENCE_URL
51
+ distribution = POM_LICENCE_DIST
60
52
}
61
53
}
62
54
63
55
developers {
64
56
developer {
65
- id POM_DEVELOPER_ID
66
- name POM_DEVELOPER_NAME
57
+ id = POM_DEVELOPER_ID
58
+ name = POM_DEVELOPER_NAME
67
59
}
68
60
}
61
+ scm {
62
+ connection = ' scm:git:git://github.com/Snapchat/dagger-browser.git'
63
+ developerConnection = ' scm:git:ssh://github.com/Snapchat/dagger-browser.git'
64
+ url = ' https://github.com/Snapchat/dagger-browser'
65
+ }
69
66
}
70
-
71
67
}
72
68
}
69
+ repositories {
70
+ maven {
71
+ url = isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl()
72
+
73
+ credentials {
74
+ username = getRepositoryUsername()
75
+ password = getRepositoryPassword()
76
+ }
77
+ }
73
78
}
79
+ }
74
80
75
81
signing {
76
82
required { isReleaseBuild() && gradle. taskGraph. hasTask(" uploadArchives" ) }
0 commit comments