-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sbt-sonatype
sonatypeBundleRelease
failed use Java8
#548
Comments
@xerial I use And the zip file can upload with curl that we do not need to put the user token in project configuration. The curl command is very short and show in the swagger UI in maven central and maven central doc, so it's easy to write it manual in CI. Now I just run |
Thanks for the report. Unfortunately, however, I don't have much control over the behavior of sonatype-central-client library, so the fix should first be made there. An ideal direction for me is:
|
@xerial I think change The readme.md in https://github.com/lumidion/sonatype-central-client is also allow user to set the backend manual. Default |
@Andrapyre What kind of errors are you getting? I haven't tried Java 8 for a long time now, but at some point we did switch to building on Java 11 - that should be findable in the release notes (though this was a long time ago as well) |
Here is the ticket for the error in the sonatype central client. lumidion/sonatype-central-client#11 The error seems to imply that the code itself was compiled beforehand in Java 11 before being compiled to Java 8. I am cleaning the environment before compiling, so it shouldn't be an environment problem. Does the lib itself contain any precompiled classes? |
@Andrapyre no, nothing is pre-compiled. So if you are building from scratch, you must have something cached somewhere. |
@adamw , I had forgotten that (unlike in languages like Rust, where you get the source code directly in the lib) all JVM libs are compiled to Java byte code already (like in this jar), so of course this would generate an error for Java 8, if the libs are being built and published on a Java 11 machine. I will try to create a backend that is compatible with Java 8 in the next few days. HttpURLConnectionBackend is built on HttpClient, which ships with Java 11, so that's out. Refactoring the OkHttp backend seems more feasible. I'll see if I can get that to work. Following updates will be in this ticket: lumidion/sonatype-central-client#11 |
@Andrapyre The |
@djx314 , sonatype-central-client supports two clients, one based on I've put more context for the issues with sttp here. |
1Use a special http client abstraction is the best. 2My workaround is discribed in this page. Just set publishTo := sonatypePublishToBundle.value to all project. // build.sbt
`project1` / publishTo := (`project1` / sonatypePublishToBundle).value
`project2` / publishTo := (`project2` / sonatypePublishToBundle).value
`project3` / publishTo := (`project3` / sonatypePublishToBundle).value
`project4` / publishTo := (`project4` / sonatypePublishToBundle).value
`project1` / publishTo := (`project1` / sonatypePublishToBundle).value
I 7z the Now I already removed all the |
For those of you using sbt-ci-release and/or sbt-sonatype for GitHub Action deployments (while this issue is fixed), consider changing the Java version from 8 to 11—it works! See in my repo: eff3ct0/teckel@89d9502 |
sbt-sonatype
sonatypeBundleRelease
failed use Java8.This command succeed in Java17. It seems that https://github.com/lumidion/sonatype-central-client use
HttpURLConnectionBackend
.But
bundle.zip
is also generated in Java8 thoughsonatypeBundleRelease
failed.Suggestion
bundle.zip
a single task, that I can upload to maven as a zip file just use sbt and no need to use 7-zip.https://github.com/lumidion/sbt-sonatype-central/blob/94390e57822176aa919aeb9859faf610e2fafa07/src/main/scala/com/lumidion/sbt/sonatype/central/SonatypeCentralService.scala#L33
https://github.com/lumidion/sbt-sonatype-central/blob/94390e57822176aa919aeb9859faf610e2fafa07/src/main/scala/com/lumidion/sbt/sonatype/central/SonatypeCentralService.scala#L51-L93
The text was updated successfully, but these errors were encountered: