@@ -2,11 +2,7 @@ plugins {
22 id ' net.ltgt.errorprone' version " ${ errorpronePluginVersion} "
33 id ' com.github.johnrengelman.shadow' version " ${ shadowPluginVersion} "
44 id ' com.github.spotbugs' version " ${ spotbugsPluginVersion} "
5- id ' application'
6- }
7-
8- application {
9- mainClass = ' com.scalar.db.dataloader.cli.DataLoaderCli'
5+ id ' maven-publish'
106}
117
128base {
@@ -34,10 +30,9 @@ javadoc {
3430
3531// Build a fat jar
3632shadowJar {
37- mustRunAfter distZip, distTar
3833 archiveClassifier. set(" " )
3934 manifest {
40- attributes ' Main-Class' : ' com.scalar.db.dataloader.DataLoaderCli'
35+ attributes ' Main-Class' : ' com.scalar.db.dataloader.cli. DataLoaderCli'
4136 }
4237 mergeServiceFiles()
4338}
@@ -80,3 +75,57 @@ task docker(type: Exec) {
8075 workingDir ' build/docker'
8176 commandLine ' docker' , ' build' , " --tag=ghcr.io/scalar-labs/scalardb-data-loader-cli:${ project.version} " , " ."
8277}
78+
79+ // for archiving and uploading to maven central
80+ if (project. gradle. startParameter. taskNames. any { it. endsWith(' publish' ) } ||
81+ project. gradle. startParameter. taskNames. any { it. endsWith(' publishToMavenLocal' ) }) {
82+ // not to publish the fat jar to maven central
83+ shadowJar. enabled = false
84+ }
85+
86+ publishing {
87+ publications {
88+ mavenJava(MavenPublication ) {
89+ artifactId = ' scalardb-data-loader-cli'
90+ from components. java
91+ pom {
92+ name = ' ScalarDB Data Loader CLI'
93+ description = ' CLI application for exporting data from and importing data into ScalarDB'
94+ url = ' https://github.com/scalar-labs/scalardb'
95+ licenses {
96+ license {
97+ name = ' Apache License, Version 2.0'
98+ url = ' http://www.apache.org/licenses/LICENSE-2.0'
99+ }
100+ }
101+ developers {
102+ developer {
103+ id = ' hiroyuki'
104+ name = ' Hiroyuki Yamada'
105+ email = ' hiroyuki.yamada@scalar-labs.com'
106+ }
107+ developer {
108+ id = ' brfrn169'
109+ name = ' Toshihiro Suzuki'
110+ email = ' brfrn169@gmail.com'
111+ }
112+ developer {
113+ id = ' Torch3333'
114+ name = ' Vincent Guilpain'
115+ email = ' vincent.guilpain@scalar-labs.com'
116+ }
117+ }
118+ scm {
119+ connection = ' scm:git:https://github.com/scalar-labs/scalardb.git'
120+ developerConnection = ' scm:git:https://github.com/scalar-labs/scalardb.git'
121+ url = ' https://github.com/scalar-labs/scalardb'
122+ }
123+ }
124+ }
125+ }
126+ repositories {
127+ maven {
128+ url = layout. buildDirectory. dir(' staging-deploy' )
129+ }
130+ }
131+ }
0 commit comments