Skip to content
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

Mvn Clean Install Doesn't Work for M1/M2 Macs #904

Open
cicoyle opened this issue Sep 11, 2023 · 9 comments
Open

Mvn Clean Install Doesn't Work for M1/M2 Macs #904

cicoyle opened this issue Sep 11, 2023 · 9 comments
Labels
kind/bug Something isn't working

Comments

@cicoyle
Copy link
Contributor

cicoyle commented Sep 11, 2023

Expected Behavior

Successfully compile and package the project - No errors while following the README steps.

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] dapr-sdk-parent 1.10.0-SNAPSHOT .................... SUCCESS [  1.677 s]
[INFO] dapr-sdk-autogen 1.10.0-SNAPSHOT ................... SUCCESS [ 12.278 s]
[INFO] dapr-sdk 1.10.0-SNAPSHOT ........................... SUCCESS [  6.090 s]
[INFO] dapr-sdk-actors 1.10.0-SNAPSHOT .................... SUCCESS [  2.479 s]
[INFO] dapr-sdk-workflows 0.10.0-SNAPSHOT ................. SUCCESS [  1.909 s]
[INFO] dapr-sdk-springboot 1.10.0-SNAPSHOT ................ SUCCESS [  2.271 s]
[INFO] dapr-sdk-examples 1.10.0-SNAPSHOT .................. SUCCESS [  2.798 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  29.817 s
[INFO] Finished at: 2023-09-11T14:03:01-05:00
[INFO] ------------------------------------------------------------------------

Actual Behavior

$ mvn clean install
...
[INFO] Building jar: /Users/cassie/go/src/github.com/java-sdk/sdk/target/dapr-sdk-1.10.0-SNAPSHOT-javadoc.jar
[INFO] 
[INFO] --- failsafe:2.4.3-alpha-1:integration-test (default) @ dapr-sdk ---
[INFO] Failsafe report directory: /Users/cassie/go/src/github.com/java-sdk/sdk/target/failsafe-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] 
[INFO] --- jacoco:0.8.6:check (check) @ dapr-sdk ---
[INFO] Loading execution data file /Users/cassie/go/src/github.com/java-sdk/sdk/target/jacoco.exec
[INFO] Analyzed bundle 'dapr-sdk' with 113 classes
[WARNING] Rule violated for bundle dapr-sdk: lines covered ratio is 0.00, but expected minimum is 0.80
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] dapr-sdk-parent 1.10.0-SNAPSHOT .................... SUCCESS [  1.571 s]
[INFO] dapr-sdk-autogen 1.10.0-SNAPSHOT ................... SUCCESS [ 13.018 s]
[INFO] dapr-sdk 1.10.0-SNAPSHOT ........................... FAILURE [  6.813 s]
[INFO] dapr-sdk-actors 1.10.0-SNAPSHOT .................... SKIPPED
[INFO] dapr-sdk-workflows 0.10.0-SNAPSHOT ................. SKIPPED
[INFO] dapr-sdk-springboot 1.10.0-SNAPSHOT ................ SKIPPED
[INFO] dapr-sdk-examples 1.10.0-SNAPSHOT .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.692 s
[INFO] Finished at: 2023-09-11T13:56:32-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.6:check (check) on project dapr-sdk: Coverage checks have not been met. See log for details. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :dapr-sdk

Steps to Reproduce the Problem

Start with a fresh fork of the repo. Install pre-reqs. Go to root (java-sdk) and run README instruction command: mvn clean install.

$ java -version
openjdk version "11.0.19" 2023-04-18
OpenJDK Runtime Environment Temurin-11.0.19+7 (build 11.0.19+7)
OpenJDK 64-Bit Server VM Temurin-11.0.19+7 (build 11.0.19+7, mixed mode)

Work-Around

$ mvn clean install -Djacoco.skip=true
@cicoyle cicoyle added the kind/bug Something isn't working label Sep 11, 2023
@cicoyle
Copy link
Contributor Author

cicoyle commented Sep 11, 2023

According to @artursouza, the codecov output is not parsed and the tool needs to be updated. This might be related to: #875

@skyao
Copy link
Member

skyao commented Sep 12, 2023

This also doesn't work on linux and amd64.

@artursouza
Copy link
Member

This also doesn't work on linux and amd64.

It works on GitHub Actions, so, there is something breaking this for desktop users.

@skyao
Copy link
Member

skyao commented Sep 12, 2023

I tested this issue in my machine: ubuntu 20.04, amd64, with jdk11 and jdk17. All failed with same error:

[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.6:check (check) on project dapr-sdk: Coverage checks have not been met. See log for details. -> [Help 1]
[ERROR] 

@skyao
Copy link
Member

skyao commented Sep 12, 2023

I found this "lines covered ratio is 0.00":

[INFO] --- jacoco:0.8.6:check (check) @ dapr-sdk ---
[INFO] Loading execution data file /home/sky/work/code/dapr-fork/java-sdk/sdk/target/jacoco.exec
[INFO] Analyzed bundle 'dapr-sdk' with 113 classes
[WARNING] Rule violated for bundle dapr-sdk: lines covered ratio is 0.00, but expected minimum is 0.80

@ejba
Copy link
Contributor

ejba commented Sep 12, 2023

This problem affects all platforms. It's a matter of adjusting the jacoco's configuration properly in the project.

@skyao
Copy link
Member

skyao commented Sep 13, 2023

I and my workmate Zhikun had verified on different platforms, and got different result:

  • On my develop machine, ubuntu server 20.04 + intel cpu (amd64) + jdk11 and jdk 17, failed
  • On my m1 max notebook, arm64, jdk11, no probleam.
  • On zhikun's notebook, windows, intel cpu (amd64), jdk11, no probleam.

@ejba
Copy link
Contributor

ejba commented Sep 13, 2023

Got the following error on my machine (fedora)

WARNING: TestEngine with ID 'junit-vintage' failed to discover tests
org.junit.platform.commons.JUnitException: Failed to parse version of junit:junit: 4.13.2
	at org.junit.vintage.engine.JUnit4VersionCheck.parseVersion(JUnit4VersionCheck.java:54)
	at org.junit.vintage.engine.JUnit4VersionCheck.checkSupported(JUnit4VersionCheck.java:37)
	at org.junit.vintage.engine.JUnit4VersionCheck.checkSupported(JUnit4VersionCheck.java:32)
	at org.junit.vintage.engine.VintageTestEngine.discover(VintageTestEngine.java:61)
	at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:177)
	at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:164)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
[INFO] 

After this log message, the maven plugin is unable to detect the existent tests and maven proceeds to the next phase.

@salaboy
Copy link
Contributor

salaboy commented Dec 4, 2024

@artursouza can we close this? I don't find this relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants