Skip to content

Commit 1208501

Browse files
committed
[maven] add maven publish and replace langs.prop scala value
1 parent 4afd042 commit 1208501

File tree

3 files changed

+44
-29
lines changed

3 files changed

+44
-29
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ install - install any jars produced to the local Maven repository (.m2)
5050
*/
5151

5252
repositories {
53-
ivy {
54-
artifactPattern "http://angeloh.bitbucket.org/releases/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]"
53+
maven {
54+
url 'http://angeloh.bitbucket.org/releases/'
5555
}
5656
}
5757

gradle/maven.gradle

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,28 @@ apply plugin: 'maven'
1818
apply plugin: 'signing'
1919

2020
if (!hasProperty('sonatypeUsername')) {
21-
ext.sonatypeUsername = ''
21+
ext.sonatypeUsername = ''
2222
}
2323
if (!hasProperty('sonatypePassword')) {
24-
ext.sonatypePassword = ''
24+
ext.sonatypePassword = ''
25+
}
26+
27+
task sourceJar(type: Jar) {
28+
description = 'Builds a source jar artifact suitable for maven deployment.'
29+
classifier = 'sources'
30+
from sourceSets.main.java
31+
}
32+
33+
task javadocJar(type: Jar, dependsOn: ['javadoc']) {
34+
description = 'Builds a javadoc jar artifact suitable for maven deployment.'
35+
classifier = 'javadoc'
36+
from javadoc.destinationDir
37+
}
38+
39+
build.dependsOn sourceJar, javadocJar
40+
41+
artifacts {
42+
archives sourceJar, javadocJar
2543
}
2644

2745
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -30,39 +48,36 @@ if (!hasProperty('sonatypePassword')) {
3048
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
3149

3250
signing {
33-
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
34-
sign configurations.archives
51+
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
52+
sign configurations.archives
3553
}
3654

3755
uploadArchives {
38-
group 'build'
39-
description = "Does a maven deploy of archives artifacts"
56+
group 'build'
57+
description = "Does a maven deploy of archives artifacts"
4058

41-
repositories {
42-
mavenDeployer {
59+
repositories {
60+
mavenDeployer {
4361
// setUniqueVersion(false)
4462

45-
configuration = configurations.archives
46-
47-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
48-
authentication(userName: sonatypeUsername, password: sonatypePassword)
49-
}
50-
51-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
52-
authentication(userName: sonatypeUsername, password: sonatypePassword)
53-
}
63+
configuration = configurations.archives
5464

55-
if (isReleaseVersion) {
56-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
57-
}
65+
repository(url: "file:///Users/macbookpro/workspaces/repository/angeloh-bitbucket/releases")
5866

59-
configurePom(pom)
60-
}
61-
}
62-
}
67+
/*repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
68+
authentication(userName: sonatypeUsername, password: sonatypePassword)
69+
}
6370
64-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65-
// configuration methods
71+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/"") {
72+
authentication(userName: sonatypeUsername, password: sonatypePassword)
73+
}*/
6674

75+
if (isReleaseVersion) {
76+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
77+
}
6778

79+
configurePom(pom)
80+
}
81+
}
82+
}
6883

src/main/resources/langs.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
scala=io.vertx~lang-scala~2.0.0-SNAPSHOT:org.vertx.scala.platform.impl.ScalaVerticleFactory
1+
scala=io.vertx~lang-scala~0.1.0-SNAPSHOT:org.vertx.scala.platform.impl.ScalaVerticleFactory
22
.scala=scala

0 commit comments

Comments
 (0)