sonatype-nexus-community / scan-gradle-plugin

Gradle plugin that scans the dependencies of a Gradle project using Sonatype platforms: OSS Index and Nexus IQ Server.
Apache License 2.0
77 stars 21 forks source link

[BUG] NexusIQScan Plugin 2.0.8 doesn't work #74

Closed puash closed 3 years ago

puash commented 3 years ago

Describe the bug The nexusIQScan plugin execute failed in Jenkins pipeline. We are trying to setup the nexusIQSacn in a two build.gradle setup, a master and a child. However it is not working.

Below are the logs from Jenkins pipeline: 2021-04-27T05:51:53.939+0000 [INFO] [com.android.build.gradle.internal.profile.RecordingBuildListener] Task :nexusIQScan in app_bt Finished 2021-04-27T05:51:53.953+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :nexusIQScan' 2021-04-27T05:51:53.953+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :nexusIQScan' completed 2021-04-27T05:51:53.954+0000 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :nexusIQScan (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 1 mins 3.694 secs. 2021-04-27T05:51:53.954+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan failed 2021-04-27T05:51:53.954+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :app:nexusIQScan completed, executed: false 2021-04-27T05:51:53.955+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan completed, executed: true 2021-04-27T05:51:53.955+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] . . 2021-04-27T05:51:54.069+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.069+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] What went wrong: 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':nexusIQScan'. 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not scan the project: null 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Try: 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights. 2021-04-27T05:51:54.071+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.071+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is: 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':nexusIQScan'. 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205) 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263) 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)

To Reproduce Steps to reproduce the behavior:

  1. Create a repo with a two build.gradle setup, a master and a child.

  2. In the master build.gradle declare the nexus plugin: //Sonatype IQ Plugin plugins { id "org.sonatype.gradle.plugins.scan" version "2.0.8" // Update the version as needed }

  3. In the child build.gradle, apply nexus plugin and configure IQ Server settings //apply sonatype plugin apply plugin: 'org.sonatype.gradle.plugins.scan' //NexusIQ Configuration nexusIQScan { username = 'admin' // Make sure to use an user with the role 'Application Evaluator' in the given IQ Server application password = 'pass' serverUrl = 'http://localhost:8070' applicationId = 'app' stage = 'build' // build is used if omitted allConfigurations = true // if true includes the dependencies in all resolvable configurations. By default is false, meaning only 'compileClasspath' and 'releaseCompileClasspath' are considered resultFilePath = 'results.json' // Optional. JSON file containing results of the evaluation }

  4. In Jenkins pipeline, run the following command: ./gradlew nexusIQScan

  5. See pipeline logs

Expected behavior Able to scan the OSS in the Application code View the report in Nexus IQ WebUI

Desktop (please complete the following information):

guillermo-varela commented 3 years ago

Hi @puash,

Is version 2.0.7 working for your pipeline?

guillermo-varela commented 3 years ago

Also @puash:

In the master build.gradle declare the nexus plugin

In the child build.gradle, apply nexus plugin and configure IQ Server settings

The plugin can be applied and configured directly on the root project (or master as you call it), is there a reason why you're applying this on the "child" project?

puash commented 3 years ago

Hi @puash,

Is version 2.0.7 working for your pipeline?

Hi @guillermo-varela, version 2.0.7 give the same error too

puash commented 3 years ago

Also @puash:

In the master build.gradle declare the nexus plugin

In the child build.gradle, apply nexus plugin and configure IQ Server settings

The plugin can be applied and configured directly on the root project (or master as you call it), is there a reason why you're applying this on the "child" project?

Hi @guillermo-varela , Sorry I made a mistake in the steps to reproduce in my first post. The error msg produced when I apply and configure the plugin in the child project build.gradle file (refer to method 3).

I tested 3 methods using the plugin (version 1.2.3 -2.0.8) however non of it works.

Method (1): Apply and configure the plugin in root project (master)

In the master build.gradle declare the nexus plugin: //Sonatype IQ Plugin plugins { id "org.sonatype.gradle.plugins.scan" version "2.0.8" // Update the version as needed } //apply sonatype plugin apply plugin: 'org.sonatype.gradle.plugins.scan' //NexusIQ Configuration nexusIQScan { username = 'admin' // Make sure to use an user with the role 'Application Evaluator' in the given IQ Server application password = 'pass' serverUrl = 'http://localhost:8070' applicationId = 'app' stage = 'build' // build is used if omitted allConfigurations = true // if true includes the dependencies in all resolvable configurations. By default is false, meaning only 'compileClasspath' and 'releaseCompileClasspath' are considered resultFilePath = 'results.json' // Optional. JSON file containing results of the evaluation }

Method (2): Apply the plugin in root project (master) and configure it in the app project (child)

In the master build.gradle declare the nexus plugin: //Sonatype IQ Plugin plugins { id "org.sonatype.gradle.plugins.scan" version "2.0.8" // Update the version as needed }

In the child build.gradle, apply nexus plugin and configure IQ Server settings //apply sonatype plugin apply plugin: 'org.sonatype.gradle.plugins.scan' //NexusIQ Configuration nexusIQScan { username = 'admin' // Make sure to use an user with the role 'Application Evaluator' in the given IQ Server application password = 'pass' serverUrl = 'http://localhost:8070' applicationId = 'app' stage = 'build' // build is used if omitted allConfigurations = true // if true includes the dependencies in all resolvable configurations. By default is false, meaning only 'compileClasspath' and 'releaseCompileClasspath' are considered resultFilePath = 'results.json' // Optional. JSON file containing results of the evaluation }

Method (3): Apply and configure the plugin in app project (child)

In the child build.gradle declare the nexus plugin: //Sonatype IQ Plugin plugins { id "org.sonatype.gradle.plugins.scan" version "2.0.8" // Update the version as needed } //apply sonatype plugin apply plugin: 'org.sonatype.gradle.plugins.scan' //NexusIQ Configuration nexusIQScan { username = 'admin' // Make sure to use an user with the role 'Application Evaluator' in the given IQ Server application password = 'pass' serverUrl = 'http://localhost:8070' applicationId = 'app' stage = 'build' // build is used if omitted allConfigurations = true // if true includes the dependencies in all resolvable configurations. By default is false, meaning only 'compileClasspath' and 'releaseCompileClasspath' are considered resultFilePath = 'results.json' // Optional. JSON file containing results of the evaluation }

Method (1) error logs:

2021-04-28T09:13:27.087+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute 'allprojects {}' action' 2021-04-28T09:13:27.087+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute 'allprojects {}' action' completed 2021-04-28T09:13:27.088+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute scan for :nexusIQScan' 2021-04-28T09:13:27.088+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute scan for :nexusIQScan' completed 2021-04-28T09:13:27.090+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot outputs after executing task ':nexusIQScan'' started 2021-04-28T09:13:27.094+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Snapshot outputs after executing task ':nexusIQScan'' 2021-04-28T09:13:27.094+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot outputs after executing task ':nexusIQScan'' completed 2021-04-28T09:13:27.097+0000 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':nexusIQScan' from context. 2021-04-28T09:13:27.098+0000 [INFO] [com.android.build.gradle.internal.profile.RecordingBuildListener] Task :nexusIQScan in app_bt Finished 2021-04-28T09:13:27.108+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :nexusIQScan' 2021-04-28T09:13:27.109+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :nexusIQScan' completed 2021-04-28T09:13:27.109+0000 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :nexusIQScan (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 1 mins 4.652 secs. 2021-04-28T09:13:27.109+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan failed 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :app_bt:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :cardmodule:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :download:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :feedback:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :fileprocessing:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :loginmodule:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :moduleads:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :moduleanalytics:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :network:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :pdfdirector:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :purger:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :rewardsmodule:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :texttospeech:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :uikit:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :virocore:nexusIQScan completed, executed: false 2021-04-28T09:13:27.110+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :webviewads:nexusIQScan completed, executed: false 2021-04-28T09:13:27.111+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan completed, executed: true 2021-04-28T09:13:27.111+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 2: released lock on : 2021-04-28T09:13:27.111+0000 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.21 completed (1 worker(s) in use) 2021-04-28T09:13:27.111+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 2: released lock on root.1.21 . . 2021-04-28T09:13:27.197+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 2021-04-28T09:13:27.197+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-28T09:13:27.197+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] What went wrong: 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':nexusIQScan'. 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not scan the project: null 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Try: 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights. 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-28T09:13:27.198+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is: 2021-04-28T09:13:27.199+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':nexusIQScan'. 2021-04-28T09:13:27.200+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205) 2021-04-28T09:13:27.200+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)

Method (2) error logs:

2021-04-27T07:48:46.188+0000 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 2021-04-27T07:48:46.188+0000 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :nexusIQScan FAILED 2021-04-27T07:48:46.188+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :nexusIQScan' started 2021-04-27T07:48:46.199+0000 [INFO] [com.android.build.gradle.internal.profile.RecordingBuildListener] Task :nexusIQScan in app_bt Starting 2021-04-27T07:48:46.224+0000 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Putting task artifact state for task ':nexusIQScan' into context took 0.021 secs. 2021-04-27T07:48:46.239+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot task inputs for :nexusIQScan' started 2021-04-27T07:48:46.252+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Snapshot task inputs for :nexusIQScan' 2021-04-27T07:48:46.252+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot task inputs for :nexusIQScan' completed 2021-04-27T07:48:46.252+0000 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':nexusIQScan' from context. 2021-04-27T07:48:46.253+0000 [INFO] [com.android.build.gradle.internal.profile.RecordingBuildListener] Task :nexusIQScan in app_bt Finished 2021-04-27T07:48:46.278+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :nexusIQScan' 2021-04-27T07:48:46.278+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :nexusIQScan' completed 2021-04-27T07:48:46.278+0000 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :nexusIQScan (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 0.123 secs. 2021-04-27T07:48:46.279+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan failed 2021-04-27T07:48:46.279+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :app_bt:nexusIQScan completed, executed: false 2021-04-27T07:48:46.279+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :cardmodule:nexusIQScan completed, executed: false 2021-04-27T07:48:46.279+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :download:nexusIQScan completed, executed: false 2021-04-27T07:48:46.279+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :feedback:nexusIQScan completed, executed: false 2021-04-27T07:48:46.279+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :fileprocessing:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :loginmodule:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :moduleads:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :moduleanalytics:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :network:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :pdfdirector:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :purger:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :rewardsmodule:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :texttospeech:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :uikit:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :virocore:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :webviewads:nexusIQScan completed, executed: false 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan completed, executed: true 2021-04-27T07:48:46.280+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 2: released lock on : 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.14 completed (1 worker(s) in use) 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 2: released lock on root.1.14 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 2,5,main]] finished, busy: 0.123 secs, idle: 0.02 secs 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':',5,main]] finished, busy: 0.0 secs, idle: 0.138 secs 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 4,5,main]] finished, busy: 0.0 secs, idle: 0.138 secs 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 3,5,main]] finished, busy: 0.0 secs, idle: 0.138 secs 2021-04-27T07:48:46.281+0000 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Daemon worker,5,main]] finished, busy: 0.0 secs, idle: 0.138 secs 2021-04-27T07:48:46.282+0000 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 5,5,main]] finished, busy: 0.0 secs, idle: 0.138 secs 2021-04-27T07:48:46.293+0000 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph] Timing: Executing the DAG took 0.185 secs 2021-04-27T07:48:46.297+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks' 2021-04-27T07:48:46.297+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run tasks' completed . . 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] What went wrong: 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Some problems were found with the configuration of task ':nexusIQScan' (type 'NexusIqScanTask'). 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No value has been specified for property 'applicationId'. 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No value has been specified for property 'password'. 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No value has been specified for property 'serverUrl'. 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No value has been specified for property 'username'. 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T07:48:46.484+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Try: 2021-04-27T07:48:46.485+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights. 2021-04-27T07:48:46.485+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T07:48:46.485+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is: 2021-04-27T07:48:46.487+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':nexusIQScan' (type 'NexusIqScanTask'). 2021-04-27T07:48:46.488+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:71)

Method (3) error logs:

2021-04-27T05:51:53.939+0000 [INFO] [com.android.build.gradle.internal.profile.RecordingBuildListener] Task :nexusIQScan in app_bt Finished 2021-04-27T05:51:53.953+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :nexusIQScan' 2021-04-27T05:51:53.953+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :nexusIQScan' completed 2021-04-27T05:51:53.954+0000 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :nexusIQScan (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 1 mins 3.694 secs. 2021-04-27T05:51:53.954+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan failed 2021-04-27T05:51:53.954+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :app:nexusIQScan completed, executed: false 2021-04-27T05:51:53.955+0000 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :nexusIQScan completed, executed: true 2021-04-27T05:51:53.955+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] . . 2021-04-27T05:51:54.069+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.069+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] What went wrong: 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':nexusIQScan'. 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not scan the project: null 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Try: 2021-04-27T05:51:54.070+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights. 2021-04-27T05:51:54.071+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-04-27T05:51:54.071+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is: 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':nexusIQScan'. 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205) 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263) 2021-04-27T05:51:54.072+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)

guillermo-varela commented 3 years ago

Hi @puash,

Focusing on "method 1", I created a small Gradle project with a child using some minimal configurations, but the plugin worked correctly: gradle-sample.zip

Could you please attach your project or at least some details you see the differences between yours and the one I uploaded?

For "method 2", I believe the error is due to trying to run the plugin from the root project rather than from the child project. But since method 3 is not working I'd think running the project from the child might fail as well.

It would also be helpful if you can share the full stacktrace running the project like this for "method 1": ./gradlew nexusIQScan --stacktrace

Thanks.

puash commented 3 years ago

Hi @guillermo-varela,

Please find the logs (./gradlew nexusIQScan --stacktrace) and gradle sample attached. gradle-smaple-and-logs.zip

Thanks.

guillermo-varela commented 3 years ago

Hi @puash,

I tried your sample project but gradle is unable to process it.

On the root build.gradle

buildscript {
    ext.kotlin_version = '1.3.72'

    repositories {
        google()
        jcenter()
        mavenCentral()
        gradlePluginPortal()
    }

    dependencies {
    implementation 'org.apache.commons:commons-collections4:4.4'
    classpath 'com.android.tools.build:gradle:4.0.1'
        classpath "org.jlleitschuh.gradle:ktlint-gradle:9.2.1"
    }
}

The implementation dependency cannot be applied inside a buildscript block.

On the child gradle.build

apply plugin: 'java-library'

plugins {
  id 'java-library'
}

buildscript {
    repository 
    {
        maven{ url 'https://plugins.gradle.org/m2/' }
    }
}

android {
    compileSdkVersion 30
...

Could you please double check your sample project?

Thanks.

puash commented 3 years ago

Hi @guillermo-varela,

I can only show u the format of my build.gradle but I don't think you can run the build directly as it consist a lot of my local files.

FYI, my gradle file is only able to apply old syntax plugin.

Please more details in the build-gradle attached. (NOTE: I modified the master build.gradle, settings.gradle and child build.gradle) gradle-sample-04May.zip

guillermo-varela commented 3 years ago

Hi @puash,

I was able to reproduce the error after making some minor changes so the "nexusIQScan" could run, even using the version 2.0.9 of this plugin.

Caused by: java.util.ConcurrentModificationException
        at org.gradle.api.internal.DefaultDomainObjectCollection$IteratorImpl.next(DefaultDomainObjectCollection.java:479)
        at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.findResolvedDependencies(DependenciesFinder.java:80)
        at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.lambda$findModules$9(DependenciesFinder.java:108)
        at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:42)
        at org.gradle.internal.Actions.with(Actions.java:251)

I'm attaching the modified project here for reference: gradle-sample-error-reproduced.zip

Thanks for sharing this with us :)

puash commented 3 years ago

Hi @guillermo-varela,

As you are able to reproduce the error, may I know is there any resolution for it?

How can I make the plugin works in my environment ?

I tried to use plugin 2.0.9 but it still produce the following error:

Starting a Gradle Daemon (subsequent builds will be faster)

Task :nexusIQScan FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':nexusIQScan'.

    Could not scan the project: null

  • Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':nexusIQScan'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205) at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) Caused by: org.gradle.api.GradleException: Could not scan the project: null at org.sonatype.gradle.plugins.scan.nexus.iq.NexusIqScanTask.scan(NexusIqScanTask.java:124) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:727) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:694) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:568) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265) at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:63) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:153) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:67) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:41) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39) at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40) at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28) at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192) ... 30 more Caused by: java.util.ConcurrentModificationException at org.gradle.api.internal.DefaultDomainObjectCollection$IteratorImpl.next(DefaultDomainObjectCollection.java:479) at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.findResolvedDependencies(DependenciesFinder.java:80) at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.lambda$findModules$9(DependenciesFinder.java:108) at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:42) at org.gradle.internal.Actions.with(Actions.java:251) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator$2$1.run(BuildOperationCrossProjectConfigurator.java:79) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator$2.run(BuildOperationCrossProjectConfigurator.java:76) at org.gradle.internal.Factories$1.create(Factories.java:26) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:212) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:193) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator.runProjectConfigureAction(BuildOperationCrossProjectConfigurator.java:73) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator.access$400(BuildOperationCrossProjectConfigurator.java:32) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator$1.doRunProjectConfigure(BuildOperationCrossProjectConfigurator.java:67) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator$BlockConfigureBuildOperation.run(BuildOperationCrossProjectConfigurator.java:121) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator.runBlockConfigureAction(BuildOperationCrossProjectConfigurator.java:64) at org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator.allprojects(BuildOperationCrossProjectConfigurator.java:54) at org.gradle.api.internal.project.DefaultProject.allprojects(DefaultProject.java:665) at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.findModules(DependenciesFinder.java:94) at org.sonatype.gradle.plugins.scan.nexus.iq.NexusIqScanTask.scan(NexusIqScanTask.java:105) ... 92 more

Thanks.

Best regards, Sze Hui

guillermo-varela commented 3 years ago

Hi @puash,

We'll need to take a deeper look into this in order to provide a solution. I hope this can reviewed in our next development cycle next week.

Thanks.

puash commented 3 years ago

Hi @guillermo-varela

Any update for this ?

Thanks.

guillermo-varela commented 3 years ago

Hi @puash,

I apologize for this issue taking so long to be fixed and the inconvenience this is causing you.

Another ongoing fix has been taking more than originally expected. This ticket is next in line so you can be sure it will be definitely be worked on.

Thanks for being patient and for expressing your interest in this fix as it reinforces the decision to put this ticket ahead of others :)

puash commented 3 years ago

Hi @guillermo-varela,

We are the existing customer of Nexus IQ and one of the reason we choose Sonatype is because its able to integrate Jenkins pipeline to automate OSS scanning.

This fix is important for us as it is affect our entire SDLC process. Without the fix we are not able to scan the open source code in our CI/CD pipeline while developer check-in their codes as all our application are created with parent and child build.gradle.

guillermo-varela commented 3 years ago

Hi @puash,

We appreciate you have chosen Sonatype and we're also thankful for the patience you have had on this issue.

As this is a Community project we can't commit to official due date, but we're definitely committed to deliver services, integrations and plugins of quality.

A fix for the issue presented here was developed (the ConcurrentModificationException error), tested and published in version 2.0.10.

Also, checking the sample project you provided I noted this plugin is applied both at the root project and inside the allprojects closure as well.

Please apply the plugin just at the root/parent project, it then should automatically process the child projects/modules.

Please give it a try and let us know if there are more issues left.

puash commented 3 years ago

Hi @guillermo-varela,

Also, checking the sample project you provided I noted this plugin is applied both at the root project and inside the allprojects closure as well.

Please apply the plugin just at the root/parent project, it then should automatically process the child projects/modules.

What do you mean on the above? I thought we should add the following into the root/parent build.gradle ?

plugins { id 'org.sonatype.gradle.plugins.scan' version '2.0.10' // Update the version as needed } apply plugin: "org.sonatype.gradle.plugins.scan"

nexusIQScan { username = 'admin' // Make sure to use an user with the role 'Application Evaluator' in the given IQ Server application password = 'pass' serverUrl = 'http://localhost:8070' applicationId = 'app' stage = 'build' // build is used if omitted allConfigurations = false // if true includes the dependencies in all resolvable configurations. By default is false, meaning only 'compileClasspath', 'runtimeClasspath', 'releaseCompileClasspath' and 'releaseRuntimeClasspath' are considered resultFilePath = 'results.json' // Optional. JSON file containing results of the evaluation }

puash commented 3 years ago

Hi @guillermo-varela,

The plugin 2.0.10 still doesn't work for our environment. Please find the logs and gradle.build attached. Command: sh './gradlew nexusIQScan --stacktrace --debug --scan'

Please advice.

Thanks.

Best regards, Sze Hui 27MayLogs.txt gradle-sample-27May.zip

guillermo-varela commented 3 years ago

What do you mean on the above? I thought we should add the following into the root/parent build.gradle ?

Yes, the plugin needs to be added and applied in the root/parent build.gradle file.

Also, checking the sample project you provided I noted this plugin is applied both at the root project and inside the allprojects closure as well.

Please apply the plugin just at the root/parent project, it then should automatically process the child projects/modules. What I meant there is that there is no need to apply it in an allprojects closure.

In a previous build.gradle sample I saw you had this:

allprojects {
    //apply sonatype plugin
    apply plugin: "org.sonatype.gradle.plugins.scan"
}

That is not necessary, all you need to do to apply the plugin is this on the root build.gradle file:

plugins {
    id 'org.sonatype.gradle.plugins.scan' version '2.0.10'
}

Please note apply plugin: "org.sonatype.gradle.plugins.scan" is not required at all when you use the plugins syntax shown above.

As per the logs you attached more recently, this part caught my attention:

Caused by: java.util.ConcurrentModificationException
    at org.gradle.api.internal.DefaultDomainObjectCollection$IteratorImpl.next(DefaultDomainObjectCollection.java:479)
    at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.findResolvedDependencies(DependenciesFinder.java:69)
    at org.sonatype.gradle.plugins.scan.common.DependenciesFinder.lambda$findModules$9(DependenciesFinder.java:97)

Lines 69 and 97 of the class DependenciesFinder.java correspond to executed code for version 2.0.8: https://github.com/sonatype-nexus-community/scan-gradle-plugin/blob/2.0.8/src/main/java/org/sonatype/gradle/plugins/scan/common/DependenciesFinder.java#L69

https://github.com/sonatype-nexus-community/scan-gradle-plugin/blob/2.0.8/src/main/java/org/sonatype/gradle/plugins/scan/common/DependenciesFinder.java#L97

For version 2.0.10 those lines don't seem to match to what is being executed (line 69 is not even part of a method):

https://github.com/sonatype-nexus-community/scan-gradle-plugin/blob/2.0.10/src/main/java/org/sonatype/gradle/plugins/scan/common/DependenciesFinder.java#L69

https://github.com/sonatype-nexus-community/scan-gradle-plugin/blob/2.0.10/src/main/java/org/sonatype/gradle/plugins/scan/common/DependenciesFinder.java#L97

My guess is that some of the child Gradle projects you have is still applying version 2.0.8 of this plugin. Please double check the build.gradle files you have in your projects and make sure only the root project applies the plugin and it's version 2.0.10.

Thanks.