What need to install locally for build latest code?

in windows 10

npm install --global yarn

powershell

./gradlew build

but show me this error

> Task :sonar-scanner-engine:test
Excluding []
Excluding []
Custom actions are attached to task ':sonar-scanner-engine:test'.
Build cache key for task ':sonar-scanner-engine:test' is da30120cea6a97f13ca4391fff34ba2d
Task ':sonar-scanner-engine:test' is not up-to-date because:
  No history is available.
Starting process 'Gradle Test Executor 6'. Working directory: D:\Users\GAMEMAX\Downloads\sonarqube-10.1.0.73491\sonar-scanner-engine Command: C:\Program Files\Java\jdk-17\bin\java.exe -Djava.awt.headless=true -Dorg.gradle.internal.worker.tmpdir=D:\Users\GAMEMAX\Downloads\sonarqube-10.1.0.73491\sonar-scanner-engine\build\tmp\test\work -Dorg.gradle.native=false -javaagent:build/tmp/expandedArchives/org.jacoco.agent-0.8.8.jar_a33b649e552c51298e5a242c2f0d0e3c/jacocoagent.jar=destfile=build/jacoco/test.exec,append=true,includes=com.sonar.*:com.sonarsource.*:org.sonar.*:org.sonarqube.*:org.sonarsource.*,inclnolocationclasses=false,dumponexit=true,output=file,jmx=false @C:\Users\GAMEMAX\.gradle\.tmp\gradle-worker-classpath2258144442415581961txt -Xmx1G -Dfile.encoding=UTF8 -Duser.country=CO -Duser.language=es -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 6'
Successfully started process 'Gradle Test Executor 6'

org.sonar.batch.bootstrapper.BatchTest > testBuilder STANDARD_OUT
    2019-05-02T00:00:00-0500
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

org.sonar.scanner.bootstrap.GlobalTempFolderProviderTest > homeIsSymbolicLink SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > givenDirectoryWithoutReadPermissionWhenIncludedThenScanShouldFail SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > givenFileWithoutAccessWhenChildrenAreExcludedThenThenScanShouldFail SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > givenDirectoryWithoutReadPermissionUnderSourcesWhenAnalysedThenShouldFail SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > givenDirectoryWhenAllChildrenAreExcludedThenSkippedFilesShouldBeReported SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > analysisFailsSymbolicLinkWithoutTargetIsInTheFolder SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > scanProjectWithSourceSymlink SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > givenPathsWithoutReadPermissionWhenAllChildrenAreExcludedThenScannerShouldSkipIt SKIPPED

org.sonar.scanner.mediumtest.fs.FileSystemMediumIT > givenDirectoryWithoutReadPermissionWhenNotIncludedThenScanShouldSkipIt SKIPPED

org.sonar.scanner.report.ChangedLinesPublisherTest > write_changed_files SKIPPED

org.sonar.scm.git.CompositeBlameCommandTest > dont_fail_with_symlink[0: GIT_NATIVE_BLAME] SKIPPED

org.sonar.scm.git.CompositeBlameCommandTest > dont_fail_with_symlink[1: GIT_FILES_BLAME] SKIPPED

org.sonar.scm.git.CompositeBlameCommandTest > skip_files_when_head_commit_is_missing[0: GIT_NATIVE_BLAME] SKIPPED

org.sonar.scm.git.CompositeBlameCommandTest > skip_files_when_head_commit_is_missing[1: GIT_FILES_BLAME] SKIPPED

org.sonar.scm.git.CompositeBlameCommandTest > skip_files_not_committed[0: GIT_NATIVE_BLAME] SKIPPED

org.sonar.scm.git.GitScmProviderTest > branchChangedLinesWithFileMovementDetection_detects_modified_lines_on_renamed_pr_files_compared_to_original_files_on_target_branch FAILED
    java.lang.AssertionError:
    Expecting map:
      {C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m1.xoo=[0, 1, 2, 3], C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m2.xoo=[0, 1, 2, 3]}
    to contain only:
      [C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m1.xoo=[2],
        C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m2.xoo=[1]]
    map entries not found:
      [C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m1.xoo=[2],
        C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m2.xoo=[1]]
    and map entries not expected:
      [C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m2.xoo=[0, 1, 2, 3],
        C:\Users\GAMEMAX\AppData\Local\Temp\junit4873861307803557842\junit6049821783808915322\new-file-m1.xoo=[0, 1, 2, 3]]
        at org.sonar.scm.git.GitScmProviderTest.branchChangedLinesWithFileMovementDetection_detects_modified_lines_on_renamed_pr_files_compared_to_original_files_on_target_branch(GitScmProviderTest.java:462)

org.sonar.scm.git.JGitBlameCommandTest > symlink_doesnt_fail SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_should_not_be_enabled_if_version_command_is_not_found SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > throw_exception_if_symlink_found SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > do_not_execute SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_should_not_be_detected SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > execution_on_windows_should_fallback_to_full_path SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > modified_file_returns_no_blame SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_blame_uses_safe_local_repository SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > blame_different_author_and_committer SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > execution_on_windows_is_disabled_if_git_not_on_path SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_should_not_be_enabled_if_version_command_does_not_return_string_output SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > blame_without_email_doesnt_fail SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_should_not_be_enabled_if_version_is_less_than_required_minimum SKIPPE

org.sonar.scm.git.NativeGitBlameCommandTest > blame_collects_all_lines SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > should_read_lines_only_based_on_new_line SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > blame_mail_with_spaces_doesnt_fail SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_should_be_enabled_if_version_is_equal_or_greater_than_required_minimum SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > throw_exception_if_command_fails SKIPPED

org.sonar.scm.git.NativeGitBlameCommandTest > git_should_be_detected SKIPPED

org.sonar.scm.git.ProcessWrapperFactoryTest > should_log_error_output_in_debug_mode FAILED
    java.lang.AssertionError:
    Expecting actual throwable to be an instance of:
      java.lang.IllegalStateException
    but was:
      java.io.IOException: Cannot run program "git" (in directory "C:\Users\GAMEMAX\AppData\Local\Temp\junit12936342308257023142\junit190559840627904735"): CreateProcess error=2, El sistema no puede encontrar el archivo especificado
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
        at org.sonar.scm.git.ProcessWrapperFactory$ProcessWrapper.execute(ProcessWrapperFactory.java:64)
        ...(50 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed)
        at org.sonar.scm.git.ProcessWrapperFactoryTest.should_log_error_output_in_debug_mode(ProcessWrapperFactoryTest.java:48)

Gradle Test Executor 6 finished executing tests.

> Task :sonar-scanner-engine:test

1121 tests completed, 2 failed, 34 skipped
Finished generating test XML results (0.042 secs) into: D:\Users\GAMEMAX\Downloads\sonarqube-10.1.0.73491\sonar-scanner-engine\build\test-results\test
Generating HTML test report...
Finished generating test html results (0.076 secs) into: D:\Users\GAMEMAX\Downloads\sonarqube-10.1.0.73491\sonar-scanner-engine\build\reports\tests\test

> Task :sonar-scanner-engine:test FAILED
:sonar-scanner-engine:test (Thread[Execution worker Thread 4,5,main]) completed. Took 2 mins 47.057 secs.

Failed tests:
  org.sonar.scm.git.GitScmProviderTest > branchChangedLinesWithFileMovementDetection_detects_modified_lines_on_renamed_pr_files_compared_to_original_files_on_target_branch
  org.sonar.scm.git.ProcessWrapperFactoryTest > should_log_error_output_in_debug_mode


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonar-scanner-engine:test'.
> There were failing tests. See the report at: file:///D:/Users/GAMEMAX/Downloads/sonarqube-10.1.0.73491/sonar-scanner-engine/build/reports/tests/test/index.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 8m 45s
149 actionable tasks: 25 executed, 124 up-to-date
Watched directory hierarchies: [D:\Users\GAMEMAX\Downloads\sonarqube-10.1.0.73491]

how solve it?

Hello @johnfelipe
Seems like you don’t have native git installed locally, which is required for some tests to be executed.
If you are only interested in building the application, you can use the command:
./gradlew build -x test which will skip the execution of the test

1 Like
> Task :server:sonar-web:yarn_design-system

> design-system@1.0.0 build-release
> yarn install --immutable && yarn build

"yarn" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
npm ERR! Lifecycle script `build-release` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: design-system@1.0.0
npm ERR!   at location: F:\Users\GAMEMAX\Documents\MICHAELPAGE\APLICACIONES Y EJECUTABLES\sonarqube-master\server\sonar-web\design-system

> Task :server:sonar-web:yarn_design-system FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':server:sonar-web:yarn_design-system'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6m 19s
111 actionable tasks: 111 executed

how solve this new one?

INSTALL GIT

npm install --global yarn

npm install -g npm@9.8.0

i think is working

> Task :server:sonar-db-dao:dumpSchema FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':server:sonar-db-dao:dumpSchema'.
> Process 'command 'C:\Program Files\Java\jdk-17\bin\java.exe'' finished with no
n-zero exit value 137

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with
Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and
 determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:comm
and_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during
this build to ensure correctness.
Please consult deprecation warnings for more details.

BUILD FAILED in 5m 34s
196 actionable tasks: 32 executed, 164 up-to-date

new error

ok working

SNAG-0296

Deprecated Gradle features were used in this build, making it incompatible with
Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and
 determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:comm
and_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during
this build to ensure correctness.
Please consult deprecation warnings for more details.

BUILD SUCCESSFUL in 23s
237 actionable tasks: 4 executed, 233 up-to-date

Hey @johnfelipe , glad that you could set it up, and thank you for the feedback
I have created a task on our side to improve the readme so it is easier to build SonarQube project locally.

2 Likes

where can review that change?
pls share link to readme file with changes to test
Tnks

Hi,

You can keep an eye on the task Leo linked to follow the progress. I doubt any work has been done on it yet.

 
Ann

1 Like