Skip to content

Commit 5150d33

Browse files
committed
publish to central repository
1 parent 730bd50 commit 5150d33

File tree

3 files changed

+78
-5
lines changed

3 files changed

+78
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# kotlin-db-migration
22

3+
```groovy
4+
// https://search.maven.org/artifact/info.purocean/kotlin-db-migration/1.0/jar
5+
compile('info.purocean:kotlin-db-migration:1.0')
6+
```
7+
38
## Trait
49
1. simple & light
510
1. name based version

build.gradle

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.10'
2+
ext.kotlin_version = '1.3.11'
33

44
repositories {
55
mavenCentral()
@@ -9,10 +9,12 @@ buildscript {
99
}
1010
}
1111

12-
group 'yang'
13-
version '1.0-SNAPSHOT'
12+
group 'info.purocean'
13+
version '1.0'
1414

1515
apply plugin: 'kotlin'
16+
apply plugin: 'maven-publish'
17+
apply plugin: 'signing'
1618

1719
repositories {
1820
mavenCentral()
@@ -30,4 +32,70 @@ compileKotlin {
3032
}
3133
compileTestKotlin {
3234
kotlinOptions.jvmTarget = "1.8"
33-
}
35+
}
36+
37+
task sourcesJar(type: Jar) {
38+
from sourceSets.main.allSource
39+
}
40+
41+
task javadocJar(type: Jar, dependsOn: project.javadoc) {
42+
from javadoc.destinationDir
43+
}
44+
45+
publishing {
46+
publications {
47+
mavenJava(MavenPublication) {
48+
from components.java
49+
50+
artifact sourcesJar {
51+
classifier "sources"
52+
}
53+
54+
artifact javadocJar {
55+
classifier "javadoc"
56+
}
57+
58+
pom {
59+
name = 'kotlin-db-migration'
60+
description = 'A MySQL db migration'
61+
url = 'https://github.com/purocean/kotlin-db-migration'
62+
licenses {
63+
license {
64+
name = 'MIT License'
65+
url = 'https://github.com/purocean/kotlin-db-migration/blob/master/LICENSE'
66+
}
67+
}
68+
scm {
69+
url = 'https://github.com/purocean/kotlin-db-migration'
70+
connection = 'scm:https://github.com/purocean/kotlin-db-migration.git'
71+
developerConnection = 'scm:git://github.com/purocean/kotlin-db-migration.git'
72+
}
73+
developers {
74+
developer {
75+
id = 'purocean'
76+
name = 'YangZi'
77+
78+
}
79+
}
80+
}
81+
}
82+
}
83+
84+
repositories {
85+
maven {
86+
// mavenLocal()
87+
88+
url = version.endsWith('SNAPSHOT')
89+
? "https://oss.sonatype.org/content/repositories/snapshots"
90+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2"
91+
credentials {
92+
username NEXUS_USERNAME
93+
password NEXUS_PASSWORD
94+
}
95+
}
96+
}
97+
}
98+
99+
signing {
100+
sign publishing.publications.mavenJava
101+
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip

0 commit comments

Comments
 (0)