Title: Code analyzer fails when gradle wrapper is in the project (gradlew) · Issue #88 · codellm-devkit/codeanalyzer-java · GitHub
Open Graph Title: Code analyzer fails when gradle wrapper is in the project (gradlew) · Issue #88 · codellm-devkit/codeanalyzer-java
X Title: Code analyzer fails when gradle wrapper is in the project (gradlew) · Issue #88 · codellm-devkit/codeanalyzer-java
Description: Describe the bug Code analyzer fails to execute when a gradle wrapper (gradlew) is defined in the project. This is the error: /Users/
Open Graph Description: Describe the bug Code analyzer fails to execute when a gradle wrapper (gradlew) is defined in the project. This is the error: /Users/
X Description: Describe the bug Code analyzer fails to execute when a gradle wrapper (gradlew) is defined in the project. This is the error: /Users/<user>/.sdkman/candidates/java/current/bin/java -jar ~/Dow...
Opengraph URL: https://github.com/codellm-devkit/codeanalyzer-java/issues/88
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Code analyzer fails when gradle wrapper is in the project (gradlew)","articleBody":"### Describe the bug\n\nCode analyzer fails to execute when a gradle wrapper (gradlew) is defined in the project. This is the error:\n\n```\n/Users/\u003cuser\u003e/.sdkman/candidates/java/current/bin/java -jar ~/Downloads/codeanalyzer-1.0.8.jar -i /Users/\u003cuser\u003e/Development/git/wca4j/svt/gradle-java-ear -o /Users/\u003cuser\u003e/.wca/codeAnalyzer/gradle-java-ear --project-root-path /Users/\u003cuser\u003e/Development/git/wca4j/svt/gradle-java-ear --no-build -a 2 -v\n2025-01-13T12:45:02.961717\t[INFO]\tFound build.gradle or build.gradle.kts in the project directory. Using gradle to download dependencies.\njava.lang.RuntimeException: java.lang.IllegalStateException: Could not find a valid Gradle command. I did not find gradlew in the project directory or in the system PATH.\n\tat com.ibm.cldk.CodeAnalyzer.run(CodeAnalyzer.java:103)\n\tat picocli.CommandLine.executeUserObject(CommandLine.java:1767)\n\tat picocli.CommandLine.access$900(CommandLine.java:145)\n\tat picocli.CommandLine$RunLast.handle(CommandLine.java:2139)\n\tat picocli.CommandLine$RunLast.handle(CommandLine.java:2106)\n\tat picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1973)\n\tat picocli.CommandLine.execute(CommandLine.java:1902)\n\tat com.ibm.cldk.CodeAnalyzer.main(CodeAnalyzer.java:92)\nCaused by: java.lang.IllegalStateException: Could not find a valid Gradle command. I did not find gradlew in the project directory or in the system PATH.\n\tat com.ibm.cldk.utils.BuildProject.downloadLibraryDependencies(BuildProject.java:243)\n\tat com.ibm.cldk.CodeAnalyzer.analyze(CodeAnalyzer.java:121)\n\tat com.ibm.cldk.CodeAnalyzer.run(CodeAnalyzer.java:101)\n\t... 7 more\n```\n\nThe workaround is to remove (or move) the gradlew from the project, then code analyzer works fine.\n\n\n### Steps To Reproduce\n\nSteps to reproduce the behavior:\n*EDIT* \nFor https://github.com/hammingweight/gradle-java-ear we'll need to create a wrapper.\n1. Clone https://github.com/hammingweight/gradle-java-ear with `git clone https://github.com/hammingweight/gradle-java-ear`\n2. Create a gradle wrapper inside the project using `gradle wrapper`. \n3. Then replace `compile` by `implementation` and comment out the `testCompile` inside the build.gradle files under `/ejb` and `/war` folders.\n4. After that, using java 11 and gradle 7.3.3, generate a gradlew by using `gradle wrapper` in the project root folder.\n5. Execute code analyzer for the project, i.e.:\n\n```\n/Users/\u003cuser\u003e/.sdkman/candidates/java/current/bin/java -jar ~/Downloads/codeanalyzer-1.0.8.jar -i /Users/\u003cuser\u003e/Development/git/wca4j/svt/gradle-java-ear -o /Users/\u003cuser\u003e/.wca/codeAnalyzer/gradle-java-ear --project-root-path /Users/\u003cuser\u003e/Development/git/wca4j/svt/gradle-java-ear --no-build -a 2 -v\n```\n\nSee the error indicated above.\n\n\n### Observed behavior\n\nIt should use the wrapper without issues.\n\n### Expected behavior\n\nNo errors. Also, since the wrapper is used, it should not complain in case gradle is not installed in the machine.\n\n### Environment (please complete the following information):\n \n- OS: macOS 15.1.1\n - Version of Java: 11\n - Version of Gradle: 7.3.3\n\n","author":{"url":"https://github.com/fabio-franco","@type":"Person","name":"fabio-franco"},"datePublished":"2025-01-13T17:54:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/88/codeanalyzer-java/issues/88"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c56f4c6c-3ee3-118d-fa0e-30aed586f8d4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC92:3C18BD:780EFC:A38ABC:698F292B |
| html-safe-nonce | 186cabcc8d85dd6131468db0347997acad722bca49492488dbde3054a47bbd89 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzkyOjNDMThCRDo3ODBFRkM6QTM4QUJDOjY5OEYyOTJCIiwidmlzaXRvcl9pZCI6IjQzMzkyMjc2NDg3MjA4NDEwMDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0dd79a359784b0d3d390beb47720c8c4fb0d3b5d69e2c076fad6896bee79f979 |
| hovercard-subject-tag | issue:2784792560 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/codellm-devkit/codeanalyzer-java/88/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ddfec965d3c6d27210e5848db05f832fd8273937d4404e9d67818a9b1141770f/codellm-devkit/codeanalyzer-java/issues/88 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ddfec965d3c6d27210e5848db05f832fd8273937d4404e9d67818a9b1141770f/codellm-devkit/codeanalyzer-java/issues/88 |
| og:image:alt | Describe the bug Code analyzer fails to execute when a gradle wrapper (gradlew) is defined in the project. This is the error: /Users/ |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fabio-franco |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6102991c714c1a6a27d05fb4f96ea6ca87a6750b4f093b95cc57ed1b84b145a1 |
| turbo-cache-control | no-preview |
| go-import | github.com/codellm-devkit/codeanalyzer-java git https://github.com/codellm-devkit/codeanalyzer-java.git |
| octolytics-dimension-user_id | 197800760 |
| octolytics-dimension-user_login | codellm-devkit |
| octolytics-dimension-repository_id | 731300153 |
| octolytics-dimension-repository_nwo | codellm-devkit/codeanalyzer-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 731300153 |
| octolytics-dimension-repository_network_root_nwo | codellm-devkit/codeanalyzer-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d52a41ad9b9ffb9b63a1b4a600a6054be8b70b36 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width