Skyscanner / sonar-secrets

SonarQube plugin for identifying hardcoded secrets, such as passwords, API keys, AWS credentials, etc..
Other
100 stars 24 forks source link

Not able to build the JAR #32

Open anubhav1992 opened 3 years ago

anubhav1992 commented 3 years ago

Hi,

When I am running the make build command, I am getting the error on the test checks

17:07:24.297 [Report about progress of Java AST analyzer] INFO org.sonar.squidbridge.ProgressReport - 1/1 source files have been analyzed
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.041 s <<< FAILURE! - in org.sonar.skyscanner.java.checks.PrivateKeysTest
[ERROR] org.sonar.skyscanner.java.checks.PrivateKeysTest.test  Time elapsed: 0.04 s  <<< ERROR!
java.lang.NoSuchMethodError: org.assertj.core.api.Fail.fail(Ljava/lang/String;)V
    at org.sonar.skyscanner.java.checks.PrivateKeysTest.test(PrivateKeysTest.java:23)

[INFO] Running org.sonar.skyscanner.java.MyJavaRulesDefinitionTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.sonar.skyscanner.java.MyJavaRulesDefinitionTest
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   APIKeysTest.test:23 » NoSuchMethod org.assertj.core.api.Fail.fail(Ljava/lang/S...
[ERROR]   AWSCredentialsTest.test:23 » NoSuchMethod org.assertj.core.api.Fail.fail(Ljava...
[ERROR]   HighEntropyTest.test:23 » NoSuchMethod org.assertj.core.api.Fail.fail(Ljava/la...
[ERROR]   PasswordsTest.test:23 » NoSuchMethod org.assertj.core.api.Fail.fail(Ljava/lang...
[ERROR]   PrivateKeysTest.test:23 » NoSuchMethod org.assertj.core.api.Fail.fail(Ljava/la...
[INFO] 
[ERROR] Tests run: 6, Failures: 0, Errors: 5, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.775 s
[INFO] Finished at: 2021-04-27T17:07:24+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project sonar-secrets-java: There are test failures.
[ERROR] 

Could you please help me to resolve this?

adeptex commented 3 years ago

hey @anubhav1992 if you are building with Java 11, it will not work: https://github.com/Skyscanner/sonar-secrets/actions/runs/675998255

you can always use precompiled jars if you don't want to install Java 8: https://github.com/Skyscanner/sonar-secrets/releases