@@ -2,9 +2,15 @@ plugins {
22 id ' java-library'
33 id ' com.adarshr.test-logger' version ' 4.0.0'
44 id ' eclipse'
5+
6+ id ' maven-publish'
7+ id ' signing'
8+ id ' io.github.gradle-nexus.publish-plugin' version ' 2.0.0'
59}
610
7- version = ' 1.1.0'
11+ group = " org.jabref"
12+ version = ' 1.1.0-SNAPSHOT'
13+ ext. isReleaseVersion = ! version. endsWith(" SNAPSHOT" )
814
915java {
1016 sourceCompatibility = JavaVersion . VERSION_11
@@ -33,6 +39,18 @@ dependencies {
3339 testImplementation ' junit:junit:4.13.2'
3440}
3541
42+ java {
43+ withJavadocJar()
44+ withSourcesJar()
45+ }
46+ tasks. withType(JavaCompile ). configureEach {
47+ options. encoding = ' UTF-8'
48+ }
49+ tasks. withType(Javadoc ). configureEach {
50+ // Ignore warnings because of missing elements
51+ options. addStringOption(' Xdoclint:all,-missing' , ' -quiet' )
52+ }
53+
3654test {
3755 useJUnit {
3856 excludeCategories = [' mslinks.ReadTestData' , ' mslinks.WriteTestData' , ' mslinks.Examples' ]
@@ -55,4 +73,56 @@ eclipse {
5573 }
5674 }
5775 }
58- }
76+ }
77+
78+ publishing {
79+ publications {
80+ mavenJava(MavenPublication ) {
81+ artifactId = ' mslinks'
82+ from components. java
83+ pom {
84+ name = ' mslinks'
85+ description = ' Library for parsing and creating Windows shortcut files (.lnk)'
86+ url = ' https://github.com/JabRef/mslinks'
87+
88+ licenses {
89+ license {
90+ name = ' WTFPL'
91+ url = ' http://www.wtfpl.net/about/'
92+ distribution = ' repo'
93+ }
94+ }
95+
96+ developers {
97+ developer {
98+ id = ' DmitriiShamrikov'
99+ }
100+ }
101+
102+ scm {
103+ url = ' https://github.com/JabRef/mslinks'
104+ connection = ' scm:git:git://github.com/JabRef/mslinks.git'
105+ developerConnection = ' scm:git:git@github.com:JabRef/mslinks.git'
106+ }
107+ }
108+ }
109+ }
110+ }
111+
112+ signing {
113+ required = isReleaseVersion
114+ useInMemoryPgpKeys(System . getenv(" SIGNING_KEY" ), System . getenv(" SIGNING_PASSWORD" ))
115+ sign publishing. publications. mavenJava
116+ }
117+
118+ nexusPublishing {
119+ repositories {
120+ // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
121+ sonatype {
122+ username = System . getenv(" OSSRH_USERNAME" )
123+ password = System . getenv(" OSSRH_TOKEN" )
124+ nexusUrl. set(uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" ))
125+ snapshotRepositoryUrl. set(uri(" https://central.sonatype.com/repository/maven-snapshots/" ))
126+ }
127+ }
128+ }
0 commit comments