xerial / sbt-sonatype

A sbt plugin for publishing Scala/Java projects to the Maven central.
Apache License 2.0
335 stars 65 forks source link

Missing method (java.nio.file.Path.of) when using SonatypeCentralService on Java 8 #507

Closed gabb1er closed 3 months ago

gabb1er commented 3 months ago

Hello!

I'm using plugin to make a bundle upload with new Sonatype Central API.

The project is build with Java 8 and then sonatypeCentralUpload command throws following exception:

2024-08-12 14:40:01.733Z error [Sonatype] [GENERIC_ERROR] java.nio.file.Path.of(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;  - (Sonatype.scala:494)

I suppose that origin of this error is here: https://github.com/xerial/sbt-sonatype/blob/c0c099bd32574faeb282359ca00b29f7ff5721ab/src/main/scala/xerial/sbt/sonatype/SonatypeCentralService.scala#L19

In build.sbt the target JVM is set to 8, but method of in java.nio.file.Path interface is only available since Java 11.

eed3si9n commented 3 months ago

Here's my PR for this - https://github.com/xerial/sbt-sonatype/pull/508

xerial commented 3 months ago

Thanks. Released https://github.com/xerial/sbt-sonatype/releases/tag/v3.11.3 with this fix