Skip to content

Conversation

@i10416
Copy link
Contributor

@i10416 i10416 commented Jul 1, 2021

I'm going to replace junit with junit 5(junit jupiter ) for Java 9 and later compatibility.

note: -libraryJars path/to/javahome/jmods is necesarry to avoid the error below.

proguard.evaluation.IncompleteClassHierarchyException
Can't find common super class of [coursier.util.Sync] (with 1 known super classes: coursier.util.Sync) and [scala.collection.immutable.Seq] (with 1 known super classes: scala.collection.immutable.Seq))

@i10416
Copy link
Contributor Author

i10416 commented Jul 1, 2021

Now, I am investigating into following errors. 3 NPE and a coursierapi.error.SimpleResolutionError.

If you have any idea to solve this, please tell me.

Update: After removing comment out , it runs successfully.
Is there any intention for the comment out?

before

lazy val `interface-test` = project
  .disablePlugins(MimaPlugin)
//  .dependsOn(interface)
     ...

after

lazy val `interface-test` = project
  .disablePlugins(MimaPlugin)
  .dependsOn(interface)
  ...   
[info] Test coursierapi.test.VersionsTests#simple() started
[error] Test coursierapi.test.VersionsTests.simple failed: java.lang.NullPointerException: null, took 0.222s
[error]     at coursierapi.shaded.coursier.core.compatibility.package$$anon$1.label(package.scala:154)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$3(MavenRepository.scala:269)
[error]     at coursierapi.shaded.scala.util.Either.flatMap(Either.scala:352)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$2(MavenRepository.scala:268)
[error]     at coursierapi.shaded.scala.util.Either.flatMap(Either.scala:352)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$1(MavenRepository.scala:267)
[error]     at coursierapi.shaded.scala.concurrent.impl.Promise$Transformation.run(Promise.scala:430)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.lang.Thread.run(Thread.java:829)
[info] Test run finished: 1 failed, 0 ignored, 1 total, 0.262s
[info] Test run started (JUnit Jupiter)
[info] Test coursierapi.test.CompleteTests#simple() started
[error] Test coursierapi.test.CompleteTests.simple failed: java.lang.NullPointerException: null, took 0.222s
[error]     at coursierapi.shaded.coursier.core.compatibility.package$$anon$1.label(package.scala:154)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$3(MavenRepository.scala:269)
[error]     at coursierapi.shaded.scala.util.Either.flatMap(Either.scala:352)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$2(MavenRepository.scala:268)
[error]     at coursierapi.shaded.scala.util.Either.flatMap(Either.scala:352)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$1(MavenRepository.scala:267)
[error]     at coursierapi.shaded.scala.concurrent.impl.Promise$Transformation.run(Promise.scala:430)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.lang.Thread.run(Thread.java:829)
[info] Test coursierapi.test.CompleteTests#withScalaVersion() started
[error] Test coursierapi.test.CompleteTests.withScalaVersion failed: java.lang.NullPointerException: null, took 0.016s
[error]     at coursierapi.shaded.coursier.core.compatibility.package$$anon$1.label(package.scala:154)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$3(MavenRepository.scala:269)
[error]     at coursierapi.shaded.scala.util.Either.flatMap(Either.scala:352)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$2(MavenRepository.scala:268)
[error]     at coursierapi.shaded.scala.util.Either.flatMap(Either.scala:352)
[error]     at coursierapi.shaded.coursier.maven.MavenRepository.$anonfun$fetchVersions$1(MavenRepository.scala:267)
[error]     at coursierapi.shaded.scala.concurrent.impl.Promise$Transformation.run(Promise.scala:430)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.lang.Thread.run(Thread.java:829)
[info] Test run finished: 2 failed, 0 ignored, 2 total, 0.279s
[info] Test run started (JUnit Jupiter)
[info] Test coursierapi.test.FetchTests#simple() started
[error] Test coursierapi.test.FetchTests.simple failed: java.lang.RuntimeException: coursierapi.error.SimpleResolutionError$1: Error downloading com.chuusai:shapeless_2.13:2.3.3
[error]   not found: /home/yoichiro/.ivy2/local/com.chuusai/shapeless_2.13/2.3.3/ivys/ivy.xml
[error]   No organization found, took 0.265s
[error]     at coursierapi.test.FetchTests.simple(FetchTests.java:27)
[error]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]     at java.lang.reflect.Method.invoke(Method.java:566)
[error]     ...
[error] Caused by: coursierapi.error.SimpleResolutionError$1: Error downloading com.chuusai:shapeless_2.13:2.3.3
[error]   not found: /home/yoichiro/.ivy2/local/com.chuusai/shapeless_2.13/2.3.3/ivys/ivy.xml
[error]   No organization found
[error]     at coursierapi.error.SimpleResolutionError.of(SimpleResolutionError.java:11)
[error]     at coursierapi.shaded.coursier.internal.api.ApiHelper$.simpleResError(ApiHelper.scala:326)
[error]     at coursierapi.shaded.coursier.internal.api.ApiHelper$.doFetch(ApiHelper.scala:359)
[error]     at coursierapi.shaded.coursier.internal.api.ApiHelper.doFetch(ApiHelper.scala)
[error]     at coursierapi.Fetch.fetchResult(Fetch.java:244)
[error]     at coursierapi.test.FetchTests.simple(FetchTests.java:25)

@i10416 i10416 changed the title replace junit with junit jupiter replace junit with junit jupiter for java 9 and later Jul 1, 2021
apps: sbt-launcher
- name: Test
run: ./.github/scripts/ci.sh
- name: Test on java 8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote here according to ci.sh. Is it better to add evictionCheck,mimaReportBinaryIssues, and so on for java 11?

@i10416 i10416 marked this pull request as ready for review July 1, 2021 07:03
'set version in ThisBuild := "'"${{ env.TEST_VERSION }}"'"'
publishLocal
env:
JAVA_11_COMPAT: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any idea to add libraryJars option to ProguardOptions only when using Java 11?

I just added this workaround.

https://github.com/coursier/interface/pull/209/files#diff-5634c415cd8c8504fdb973a3ed092300b43c4b8fc1e184f7249eb29a55511f91R83

I tried to pass setting by 'set proguardOptions := {proguardOptions++=Seq("-libraryjars $JAVA_HOME/jmods/java.base.jmod")}.key.value' +test , but it won't work.

@alexarchambault
Copy link
Member

Thanks for opening this. I'm not sure this is mergeable as is, but I cherry-picked one of your commit in #215.

I'm not sure we absolutely need a Java 11 job on the CI, although it's nice to have. I might try to add one later on.

@i10416
Copy link
Contributor Author

i10416 commented Oct 10, 2021

@alexarchambault
Thank you for response.
Do you have any plan to migrate junit to junit 5?
If so, I will take another look at content of this PR and do some tweak because It has past a bit since I opened this PR.

@alexarchambault alexarchambault deleted the branch coursier:master June 8, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants