@@ -2,9 +2,11 @@ plugins {
22 id ' java-library'
33 id ' com.adarshr.test-logger' version ' 3.0.0'
44 id ' eclipse'
5+ id ' signing'
6+ id ' io.github.gradle-nexus.publish-plugin' version ' 2.0.0'
57}
68
7- version = ' 1.1.0'
9+ version = ' 1.1.0-SNAPSHOT '
810
911sourceCompatibility = 11.0
1012targetCompatibility = 11.0
@@ -31,6 +33,18 @@ dependencies {
3133 testImplementation ' junit:junit:4.13.2'
3234}
3335
36+ java {
37+ withJavadocJar()
38+ withSourcesJar()
39+ }
40+ tasks. withType(JavaCompile ). configureEach {
41+ options. encoding = ' UTF-8'
42+ }
43+ tasks. withType(Javadoc ). configureEach {
44+ // Ignore warnings because of missing elements
45+ options. addStringOption(' Xdoclint:all,-missing' , ' -quiet' )
46+ }
47+
3448test {
3549 useJUnit {
3650 excludeCategories = [' mslinks.ReadTestData' , ' mslinks.WriteTestData' , ' mslinks.Examples' ]
@@ -48,4 +62,56 @@ eclipse {
4862 }
4963 }
5064 }
51- }
65+ }
66+
67+ publishing {
68+ publications {
69+ mavenJava(MavenPublication ) {
70+ artifactId = ' mslinks'
71+ from components. java
72+ pom {
73+ name = ' mslinks'
74+ description = ' Library for parsing and creating Windows shortcut files (.lnk)'
75+ url = ' https://github.com/JabRef/mslinks'
76+
77+ licenses {
78+ license {
79+ name = ' WTFPL'
80+ url = ' http://www.wtfpl.net/about/'
81+ distribution = ' repo'
82+ }
83+ }
84+
85+ developers {
86+ developer {
87+ id = ' DmitriiShamrikov'
88+ }
89+ }
90+
91+ scm {
92+ url = ' https://github.com/JabRef/mslinks'
93+ connection = ' scm:git:git://github.com/JabRef/mslinks.git'
94+ developerConnection = ' scm:git:git@github.com:JabRef/mslinks.git'
95+ }
96+ }
97+ }
98+ }
99+ }
100+
101+ signing {
102+ required = isReleaseVersion
103+ useInMemoryPgpKeys(System . getenv(" SIGNING_KEY" ), System . getenv(" SIGNING_PASSWORD" ))
104+ sign publishing. publications. mavenJava
105+ }
106+
107+ nexusPublishing {
108+ repositories {
109+ // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
110+ sonatype {
111+ username = System . getenv(" OSSRH_USERNAME" )
112+ password = System . getenv(" OSSRH_TOKEN" )
113+ nexusUrl. set(uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" ))
114+ snapshotRepositoryUrl. set(uri(" https://central.sonatype.com/repository/maven-snapshots/" ))
115+ }
116+ }
117+ }
0 commit comments