Skip to content

Commit fa4ef26

Browse files
committed
Add maven publish task for common and fido2-core module
Publish common and fido2-core modules into user-defined maven repo by running below command. ./gradlew publish -Ppublish.maven.url={Repo URL} \ -Ppublish.maven.username={username} \ -Ppublish.maven.password={password} Artifacts will be published as com.linecorp.line.auth.fido.fido2:{common,fido2-core}
1 parent c9b3338 commit fa4ef26

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ subprojects {
2424
group = 'com.linecorp.line.auth.fido.fido2'
2525
version = '1.0.0-SNAPSHOT'
2626

27+
ext {
28+
getMavenPublishUrl = {
29+
return findProperty("publish.maven.url")
30+
}
31+
32+
getMavenPublishUsername = {
33+
return findProperty("publish.maven.username")
34+
}
35+
36+
getMavenPublishPassword = {
37+
return findProperty("publish.maven.password")
38+
}
39+
}
40+
2741
repositories {
2842
mavenCentral()
2943
maven {

common/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@ test {
1818
useJUnitPlatform()
1919
}
2020

21+
publishing {
22+
publications {
23+
mavenJar(MavenPublication) {
24+
from components.java
25+
}
26+
}
27+
28+
repositories {
29+
maven {
30+
url = project.ext.getMavenPublishUrl()
31+
32+
if (project.ext.getMavenPublishUsername() != null) {
33+
credentials {
34+
username = project.ext.getMavenPublishUsername()
35+
if (project.ext.getMavenPublishPassword() != null) {
36+
password = project.ext.getMavenPublishPassword()
37+
}
38+
}
39+
}
40+
}
41+
}
42+
}
43+
2144
dependencies {
2245
compile('com.fasterxml.jackson.core:jackson-databind:2.9.6')
2346
compile('com.fasterxml.jackson.core:jackson-core:2.9.6')

fido2-core/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@ plugins {
2222
jar.enabled = true
2323
bootJar.enabled = false
2424

25+
publishing {
26+
publications {
27+
mavenJar(MavenPublication) {
28+
from components.java
29+
}
30+
}
31+
32+
repositories {
33+
maven {
34+
url = project.ext.getMavenPublishUrl()
35+
36+
if (project.ext.getMavenPublishUsername() != null) {
37+
credentials {
38+
username = project.ext.getMavenPublishUsername()
39+
if (project.ext.getMavenPublishPassword() != null) {
40+
password = project.ext.getMavenPublishPassword()
41+
}
42+
}
43+
}
44+
}
45+
}
46+
}
47+
2548
dependencies {
2649
implementation project(':common')
2750

0 commit comments

Comments
 (0)