11plugins {
2- id " biz.aQute.bnd.builder" version " 5.0.1 "
2+ id " biz.aQute.bnd.builder" version " 6.4.0 "
33 id " com.diffplug.spotless" version " 5.9.0"
44}
55
66apply plugin : ' java'
77apply plugin : ' eclipse'
8- apply plugin : ' maven'
8+ apply plugin : ' maven-publish '
99apply plugin : ' signing'
1010
1111[compileJava, compileTestJava]* . options* . encoding = ' UTF-8'
@@ -15,7 +15,6 @@ Properties props = new Properties()
1515props. load(new FileInputStream (buildDir. getAbsolutePath() + " /src/main/resources/com/neuronrobotics/nrjavaserial/build.properties" ))
1616
1717group = " com.neuronrobotics"
18- archivesBaseName = " nrjavaserial"
1918version = props. " app.version"
2019
2120sourceSets {
@@ -32,21 +31,23 @@ sourceSets {
3231 }
3332}
3433
35- jar. archiveName = " nrjavaserial-${ props.'app.version'} .jar"
34+ jar. archiveBaseName = " nrjavaserial-${ props.'app.version'} .jar"
3635
3736repositories {
3837 mavenCentral()
3938 jcenter()
4039}
4140
4241dependencies {
43- compile fileTree(dir : ' libs' , includes : [' *.jar' ])
44- testCompile ' junit:junit:4.12'
45- compile ' commons-net:commons-net:3.9.0'
42+ implementation fileTree(dir : ' build/ libs' , includes : [' *.jar' ])
43+ testImplementation ' junit:junit:4.12'
44+ implementation ' commons-net:commons-net:3.9.0'
4645 compileOnly ' net.java.dev.jna:jna:4.4.0'
4746 compileOnly ' net.java.dev.jna:jna-platform:4.4.0'
4847}
4948
49+ compileTestJava. dependsOn jar
50+
5051jar {
5152 jar. duplicatesStrategy = DuplicatesStrategy . EXCLUDE
5253
@@ -64,12 +65,13 @@ jar {
6465}
6566
6667task javadocJar (type : Jar ) {
67- classifier = ' javadoc'
68+ archiveClassifier = ' javadoc'
6869 from javadoc
6970}
7071
7172task sourcesJar (type : Jar ) {
72- classifier = ' sources'
73+ archivesBaseName = " nrjavaserial"
74+ archiveClassifier = ' sources'
7375 from (sourceSets. main. allSource) {
7476 exclude ' native/'
7577 }
0 commit comments