nebula-plugins / gradle-lint-plugin

A pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts.
Apache License 2.0
768 stars 89 forks source link

NullPointerException when upgrading to v16.7.0 #307

Open rravi-sift opened 4 years ago

rravi-sift commented 4 years ago

It still happens in version 16.7.0

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':autoLintGradle'. 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:114) 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: java.lang.NullPointerException: Cannot get property 'files' on null object at com.netflix.nebula.lint.rule.dependency.DependencyService.memoizedMethodPriv$classReferencesString(DependencyService.groovy:288) at com.netflix.nebula.lint.rule.dependency.DependencyService$_closure6.doCall(DependencyService.groovy) at com.netflix.nebula.lint.rule.dependency.DependencyService.classReferences(DependencyService.groovy) at com.netflix.nebula.lint.rule.dependency.DependencyService.memoizedMethodPriv$unusedDependenciesString(DependencyService.groovy:440) at com.netflix.nebula.lint.rule.dependency.DependencyService$_closure11.doCall(DependencyService.groovy) at com.netflix.nebula.lint.rule.dependency.DependencyService.unusedDependencies(DependencyService.groovy) at com.netflix.nebula.lint.rule.dependency.DependencyService$unusedDependencies$9.call(Unknown Source) at com.netflix.nebula.lint.rule.dependency.UnusedDependencyRule.visitGradleDependency(UnusedDependencyRule.groovy:63) at com.netflix.nebula.lint.rule.GradleLintRule.this$dist$invoke$2(GradleLintRule.groovy) at com.netflix.nebula.lint.rule.GradleLintRule$1.methodMissing(GradleLintRule.groovy) at com.netflix.nebula.lint.rule.GradleLintRule$1.this$dist$invoke$3(GradleLintRule.groovy) at com.netflix.nebula.lint.rule.GradleLintRule$1$1.methodMissing(GradleLintRule.groovy) at com.netflix.nebula.lint.rule.GradleLintRule$1$1.visitMethodCallInDependencies(GradleLintRule.groovy:461) at com.netflix.nebula.lint.rule.GradleLintRule$1$1.visitMethodCallExpression(GradleLintRule.groovy:260) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor$_visitMethodCallExpression_closure31.doCall(CompositeGroovyAstVisitor.groovy:284) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitMethodCallExpression(CompositeGroovyAstVisitor.groovy:284) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitExpressionStatement(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitExpressionStatement(CompositeGroovyAstVisitor.groovy:225) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitBlockStatement(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitBlockStatement(CompositeGroovyAstVisitor.groovy:189) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$2$visitClosureExpression(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitClosureExpression(CompositeGroovyAstVisitor.groovy:347) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$2$visitListOfExpressions(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitListOfExpressions(CompositeGroovyAstVisitor.groovy:473) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$2$visitTupleExpression(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitTupleExpression(CompositeGroovyAstVisitor.groovy:353) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$2$visitArgumentlistExpression(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitArgumentlistExpression(CompositeGroovyAstVisitor.groovy:479) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$2$visitMethodCallExpression(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitMethodCallExpression(CompositeGroovyAstVisitor.groovy:286) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitExpressionStatement(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitExpressionStatement(CompositeGroovyAstVisitor.groovy:225) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitBlockStatement(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitBlockStatement(CompositeGroovyAstVisitor.groovy:189) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitClassCodeContainer(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitClassCodeContainer(CompositeGroovyAstVisitor.groovy:136) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitConstructorOrMethod(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitConstructorOrMethod(CompositeGroovyAstVisitor.groovy:147) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitMethod(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitMethod(CompositeGroovyAstVisitor.groovy:159) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.super$3$visitClass(CompositeGroovyAstVisitor.groovy) at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitClass(CompositeGroovyAstVisitor.groovy:105) at com.netflix.nebula.lint.org.codenarc.rule.AbstractAstVisitorRule.applyTo(AbstractAstVisitorRule.java:97) at com.netflix.nebula.lint.org.codenarc.rule.AbstractRule.applyTo(AbstractRule.java:142) at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source) at com.netflix.nebula.lint.rule.GradleLintRule.applyTo(GradleLintRule.groovy:197) at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source) at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source) at com.netflix.nebula.lint.org.codenarc.analyzer.AbstractSourceAnalyzer.collectViolations(AbstractSourceAnalyzer.groovy:40) at com.netflix.nebula.lint.plugin.LintService$ReportableAnalyzer.analyze(LintService.groovy:50) at com.netflix.nebula.lint.plugin.LintService$ReportableAnalyzer$analyze.call(Unknown Source) at com.netflix.nebula.lint.plugin.LintService$_lint_closure5.doCall(LintService.groovy:122) at com.netflix.nebula.lint.plugin.LintService.lint(LintService.groovy:111) at com.netflix.nebula.lint.plugin.LintService$lint.call(Unknown Source) at com.netflix.nebula.lint.plugin.LintGradleTask.lint(LintGradleTask.groovy:47) 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:67) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36) 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:159) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43) 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

Originally posted by @MatanSabag in https://github.com/nebula-plugins/gradle-lint-plugin/issues/225#issuecomment-613969923

hendrysetiadi89 commented 4 years ago

Same, but for me, it is:

Execution failed for task ':autoLintGradle'.
> Cannot get property 'canBeResolved' on null object
SG57 commented 4 years ago

Same exact trace for me, using version 16.9.1.

ygnessin commented 3 years ago

I am also seeing the 'canBeResolved' error on 16.15.7

DanielThomas commented 3 years ago

Sounds like we're seeing a null in some situtations. The original files case must be in com.netflix.nebula.lint.rule.dependency.DependencyService#sourceSetOutput, but the canBeResolved case must be different. @ygnessin would you mind posting a stacktrace please?

ygnessin commented 3 years ago

@DanielThomas sorry for the lack of detail earlier. I am seeing the same error as @hendrysetiadi89

Execution failed for task ':autoLintGradle'.
> Cannot get property 'canBeResolved' on null object

I am in a multi-module project and have nebula set up based on the recommendation in the README:

allprojects {
    apply plugin: 'nebula.lint'
    gradleLint.rules = ['all-dependency'] // add as many rules here as you'd like
}

I was not using this plugin before so this isn't an error that occurred during upgrade; it's an error that occurred as I was following the README instructions to try to set it up for the first time.

Hope that helps!

DanielThomas commented 3 years ago

Thanks @ygnessin - it'd really help to have the full error when you add --stacktrace. That way I can see exactly where that canBeResolved property access is failing because we have a few places that happens in DependencyService. Thanks in advance.

ygnessin commented 3 years ago

@DanielThomas šŸ¤¦ so sorry. Here it is:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':autoLintGradle'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
    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.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    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: java.lang.NullPointerException: Cannot get property 'canBeResolved' on null object
    at com.netflix.nebula.lint.rule.dependency.DependencyService.isResolvable(DependencyService.groovy:556)
    at com.netflix.nebula.lint.rule.dependency.DependencyService$isResolvable$6.callCurrent(Unknown Source)
    at com.netflix.nebula.lint.rule.dependency.DependencyService.findAndReplaceNonResolvableConfiguration(DependencyService.groovy:165)
    at com.netflix.nebula.lint.rule.dependency.AbstractDuplicateDependencyClassRule.visitClassComplete(AbstractDuplicateDependencyClassRule.groovy:54)
    at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor$_visitClass_closure2.doCall(CompositeGroovyAstVisitor.groovy:106)
    at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitClass(CompositeGroovyAstVisitor.groovy:106)
    at com.netflix.nebula.lint.org.codenarc.rule.AbstractAstVisitorRule.applyTo(AbstractAstVisitorRule.java:97)
    at com.netflix.nebula.lint.org.codenarc.rule.AbstractRule.applyTo(AbstractRule.java:142)
    at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source)
    at com.netflix.nebula.lint.rule.GradleLintRule.applyTo(GradleLintRule.groovy:197)
    at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source)
    at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source)
    at com.netflix.nebula.lint.org.codenarc.analyzer.AbstractSourceAnalyzer.collectViolations(AbstractSourceAnalyzer.groovy:40)
    at com.netflix.nebula.lint.plugin.LintService$ReportableAnalyzer.analyze(LintService.groovy:58)
    at com.netflix.nebula.lint.plugin.LintService$ReportableAnalyzer$analyze.call(Unknown Source)
    at com.netflix.nebula.lint.plugin.LintService$_lint_closure5.doCall(LintService.groovy:129)
    at com.netflix.nebula.lint.plugin.LintService.lint(LintService.groovy:118)
    at com.netflix.nebula.lint.plugin.LintService$lint.call(Unknown Source)
    at com.netflix.nebula.lint.plugin.LintGradleTask.lint(LintGradleTask.groovy:47)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:555)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:540)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:523)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:260)
    at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:34)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
    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.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:42)
    at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
    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:187)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
    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.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    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)
DanielThomas commented 3 years ago

That's super useful, thanks. Looks like this is related to our logic to handle/replace legacy configurations. @ygnessin or others here, do you happen to have an example where this happens? We don't see this internally and we have a mix of legacy and modern configuration builds and don't see this NPE. I could make DependencyService.isResolvable handle null configurations but I'd be concerned that we'd be actually have a bug we need to fix.

DanielThomas commented 3 years ago

Looking closer, I think the only place we can wind up with a null configuration is here:

https://github.com/nebula-plugins/gradle-lint-plugin/blob/master/src/main/groovy/com/netflix/nebula/lint/rule/dependency/DependencyService.groovy#L159-L163

But I'm not sure how we could have any of the unresolvable configurations - perhaps if there were manually created configurations with the same name. I'm going to stop this code from blindly replacing that configuration with a null and that should surface the real problem for you.

DanielThomas commented 3 years ago

Release 16.15.8 should prevent the isResolvable NPE. Let us know if you see any problems after upgrading to that release (it's building now, will be about 30 minutes).

ygnessin commented 3 years ago

@DanielThomas thanks for the quick action! Not sure if this helps, but as you predicted, with 16.15.8 I'm now getting a more detailed error message. Here it is along with the full stacktrace:

Error from [com.netflix.nebula.lint.rule.GradleLintRule$1] processing source file [null]

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':autoLintGradle'.
> Resolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'.
  Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'implementation' should be resolved.

* 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 ':autoLintGradle'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
    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.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    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: java.lang.IllegalStateException: Resolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'implementation' should be resolved.
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.assertIsResolvable(DefaultConfiguration.java:1287)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:549)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:545)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
    at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:233)
    at org.gradle.internal.metaobject.BeanDynamicObject.tryGetProperty(BeanDynamicObject.java:176)
    at org.gradle.internal.metaobject.CompositeDynamicObject.tryGetProperty(CompositeDynamicObject.java:55)
    at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:60)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getProperty(Unknown Source)
    at com.netflix.nebula.lint.rule.dependency.AbstractDuplicateDependencyClassRule.firstOrderModuleIds(AbstractDuplicateDependencyClassRule.groovy:23)
    at com.netflix.nebula.lint.rule.dependency.FirstOrderDuplicateDependencyClassRule.moduleIds(FirstOrderDuplicateDependencyClassRule.groovy:9)
    at com.netflix.nebula.lint.rule.dependency.AbstractDuplicateDependencyClassRule.visitClassComplete(AbstractDuplicateDependencyClassRule.groovy:62)
    at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor$_visitClass_closure2.doCall(CompositeGroovyAstVisitor.groovy:106)
    at com.netflix.nebula.lint.rule.CompositeGroovyAstVisitor.visitClass(CompositeGroovyAstVisitor.groovy:106)
    at com.netflix.nebula.lint.org.codenarc.rule.AbstractAstVisitorRule.applyTo(AbstractAstVisitorRule.java:97)
    at com.netflix.nebula.lint.org.codenarc.rule.AbstractRule.applyTo(AbstractRule.java:142)
    at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source)
    at com.netflix.nebula.lint.rule.GradleLintRule.applyTo(GradleLintRule.groovy:197)
    at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source)
    at com.netflix.nebula.lint.org.codenarc.rule.Rule$applyTo$0.call(Unknown Source)
    at com.netflix.nebula.lint.org.codenarc.analyzer.AbstractSourceAnalyzer.collectViolations(AbstractSourceAnalyzer.groovy:40)
    at com.netflix.nebula.lint.plugin.LintService$ReportableAnalyzer.analyze(LintService.groovy:58)
    at com.netflix.nebula.lint.plugin.LintService$ReportableAnalyzer$analyze.call(Unknown Source)
    at com.netflix.nebula.lint.plugin.LintService$_lint_closure5.doCall(LintService.groovy:129)
    at com.netflix.nebula.lint.plugin.LintService.lint(LintService.groovy:118)
    at com.netflix.nebula.lint.plugin.LintService$lint.call(Unknown Source)
    at com.netflix.nebula.lint.plugin.LintGradleTask.lint(LintGradleTask.groovy:47)
        ...
DanielThomas commented 3 years ago

@ygnessin that would seem indicate that we found the implementation configuration but not the compileClasspath configuration to replace it with. What kind of project is this failing on? What language plugins are applied?

ygnessin commented 3 years ago

@DanielThomas I'm working in android project that has multiple modules, most of which are android modules but some of which are pure java modules. It's a mix of kotlin and java. We are also using Kotlin Multi-Platform which is still an experimental feature, so there's a chance that something in there is the culprit.

Here are the gradle plugins in use:

        classpath "com.android.tools.build:gradle:$ANDROID_GRADLE_PLUGIN"
        classpath "com.google.gms:google-services:$GMS_VERSION"
        classpath "com.google.firebase:perf-plugin:$FIREBASE_PLUGIN_VERSION"
        classpath "com.google.firebase:firebase-crashlytics-gradle:$FIREBASE_CRASHLYTICS_PLUGIN_VERSION"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
        classpath "com.airbnb.okreplay:gradle-plugin:$OKREPLAY_VERSION"
        classpath "com.google.android.gms:oss-licenses-plugin:$OSS_LICENSES_PLUGIN_VERSION"

In the Kotlin Multi-Platform subproject there are these plugins:

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
        classpath "org.jetbrains.kotlin:kotlin-serialization:$KOTLIN_VERSION"
        classpath "com.github.node-gradle:gradle-node-plugin:$GRADLE_NODE_PLUGIN_VERSION"
        classpath "org.jlleitschuh.gradle:ktlint-gradle:$KTLINT_GRADLE_VERSION"

.. but if KMP is the issue then that's probably a whole other can of worms that I wouldn't expect you to spend time debugging.

Apologies if this isn't the information you were looking for, my knowledge of gradle is a bit rudimentary.

DanielThomas commented 3 years ago

@ygnessin no no, that's exactly the kind of thing I needed. I'm familiar with all of that - let me see if I can come up with a scenario where this fails locally.