Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versions past 0.44.0 generate useless output in some repos #821

Closed
jimshowalter opened this issue Dec 2, 2023 · 21 comments
Closed

Versions past 0.44.0 generate useless output in some repos #821

jimshowalter opened this issue Dec 2, 2023 · 21 comments

Comments

@jimshowalter
Copy link

In some of our repos, we're happily using 0.50.0, which generates output that looks like this:

`The following dependencies are using the latest milestone version:

  • ch.qos.logback:logback-classic:1.4.14
  • ch.qos.logback:logback-core:1.4.14
  • com.eclipsesource.minimal-json:minimal-json:0.9.5
  • com.google.code.gson:gson:2.10.1
  • com.google.guava:guava:32.1.3-jre
  • commons-codec:commons-codec:1.16.0
  • io.rest-assured:json-schema-validator:5.3.2
  • io.rest-assured:rest-assured:5.3.2
  • io.temporal:temporal-sdk:1.22.3
  • io.temporal:temporal-testing:1.22.3
  • jakarta.transaction:jakarta.transaction-api:2.0.1
  • joda-time:joda-time:2.12.5
  • org.apache.logging.log4j:log4j-to-slf4j:2.22.0
  • org.aspectj:aspectjweaver:1.9.20.1
  • org.awaitility:awaitility:4.2.0
  • org.jboss.resteasy:resteasy-jaxrs:3.15.6.Final
  • org.json:json:20231013
  • org.junit.jupiter:junit-jupiter-api:5.10.1
  • org.junit.jupiter:junit-jupiter-engine:5.10.1
  • org.junit.platform:junit-platform-commons:1.10.1
  • org.mapstruct:mapstruct:1.5.5.Final
  • org.mapstruct:mapstruct-processor:1.5.5.Final
  • org.projectlombok:lombok:1.18.30
  • org.projectlombok:lombok-mapstruct-binding:0.2.0
  • org.slf4j:jcl-over-slf4j:2.0.9
  • org.slf4j:jul-to-slf4j:2.0.9
  • org.slf4j:log4j-over-slf4j:2.0.9

The following dependencies have later milestone versions:

Failed to determine the latest version for the following dependencies (use --info for details):

  • org.junit.platform:junit-platform-launcher

Gradle release-candidate updates:

  • Gradle: [8.5: UP-TO-DATE]`

But in several other repos, any version past 0.44.0 generates output that looks like this:

`The following dependencies are using the latest milestone version:

  • org.jacoco:org.jacoco.agent:0.8.10
  • org.jacoco:org.jacoco.ant:0.8.10
  • org.junit.jupiter:junit-jupiter-engine:5.10.1
  • org.junit.platform:junit-platform-commons:1.10.1
  • org.mapstruct:mapstruct-processor:1.5.5.Final

Failed to determine the latest version for the following dependencies (use --info for details):

  • ch.qos.logback:logback-classic
    1.4.14
  • ch.qos.logback:logback-core
    1.4.14
  • com.eclipsesource.minimal-json:minimal-json
    0.9.5
  • com.google.code.gson:gson
    2.10.1
  • com.google.guava:guava
    32.1.3-jre
  • com.squareup.okhttp3:okhttp
    4.12.0
  • commons-codec:commons-codec
    1.16.0
  • io.rest-assured:json-schema-validator
    5.3.2
  • io.rest-assured:rest-assured
    5.3.2
  • io.temporal:temporal-sdk
    1.22.3
  • io.temporal:temporal-testing
    1.22.3
  • jakarta.transaction:jakarta.transaction-api
    2.0.1
  • joda-time:joda-time
    2.12.5
  • org.apache.logging.log4j:log4j-to-slf4j
    2.22.0
  • org.aspectj:aspectjweaver
    1.9.20.1
  • org.awaitility:awaitility
    4.2.0
  • org.jboss.resteasy:resteasy-jaxrs
    3.15.6.Final
  • org.json:json
    20231013
  • org.junit.jupiter:junit-jupiter-api
    5.10.1
  • org.mapstruct:mapstruct
    1.5.5.Final
  • org.mockito:mockito-junit-jupiter
    5.8.0
  • org.projectlombok:lombok
    1.18.30
  • org.projectlombok:lombok-mapstruct-binding
    0.2.0
  • org.slf4j:jcl-over-slf4j
    2.0.9
  • org.slf4j:jul-to-slf4j
    2.0.9
  • org.slf4j:log4j-over-slf4j
    2.0.9
  • org.springframework.boot:spring-boot-starter
    3.2.0
  • org.springframework.boot:spring-boot-starter-test
    3.2.0
  • org.springframework.data:spring-data-commons
    3.2.0

Gradle release-candidate updates:

  • Gradle: [8.5: UP-TO-DATE]`

We haven't been able to create a reproducible test case, but hope something in the way that output looks will trigger recognition and get it resolved.

@ben-manes
Copy link
Owner

You could use --info to see the error. It has become much harder to work with Gradle's public dependency resolution apis, which this plugin is a light wrapper on top of. Those may not always be clear errors because the build system has become very complex with its custom module metadata and popular plugins that corrupt the shared build environment to break the api contracts. These can get confusing and thorny, so we may need the Gradle team's advice if non-obvious.

@ben-manes
Copy link
Owner

Oh, try out the fix in #746 if you have a project that does not apply a java language plugin (like the root in a multi-module). You can use apply plugin: 'jvm-ecosystem' and see if that resolves it.

@ben-manes
Copy link
Owner

can you try the workaround @jimshowalter?

@Adriankhl
Copy link

I am also experiencing this, and adding java/jvm-ecosystem plugin does not work.

@ben-manes
Copy link
Owner

can you provide the exception and a reproducer?

@Adriankhl
Copy link

So this solution fixes my issue: gradle/gradle#26672
But according to the comment this should already have been fixed in gradle 8.4? I am currently using gradle 8.5.

@Adriankhl
Copy link

If you are interested, you can reproduce the issue by cloning my repo (https://github.com/Adriankhl/relativitization) and run ./gradlew dependencyUpdates -PshowUnresolved

Seems like it is more a gradle problem than a problem of this plugin. However, if it this is a common problem, I suggest to document this in README.

@ben-manes
Copy link
Owner

Oh! Well there is no fix other than removing legacy XML parsers from your build plugins. That workaround forces those dependencies to be ignored. If you have an Android project, then they fixed it in Android Gradle Plugin 8.3.0-alpha12.

@ben-manes
Copy link
Owner

Seems like it is more a gradle problem than a problem of this plugin. However, if it this is a common problem, I suggest to document this in README.

It is documented in the plugin's release notes and that gradle issue means it is also in their upgrade docs. I'm afraid that anywhere we put it will get overlooked and the Gradle error message is not very clear.

@ben-manes
Copy link
Owner

If you are interested, you can reproduce the issue by cloning my repo (https://github.com/Adriankhl/relativitization) and run ./gradlew dependencyUpdates -PshowUnresolved

fyi, you will want to add a toolchain download repository as no longer bundled in Gradle.

* What went wrong:
Could not determine the dependencies of null.
> Could not resolve all dependencies for configuration ':buildSrc:buildScriptClasspath'.
   > Failed to query the value of task ':buildSrc:compileGroovy' property 'javaLauncher'.
      > No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific} for MAC_OS on aarch64.
         > No locally installed toolchains match and toolchain download repositories have not been configured.
...
Caused by: org.gradle.jvm.toolchain.internal.ToolchainDownloadFailedException: No locally installed toolchains match and toolchain download repositories have not been configured.
        at org.gradle.jvm.toolchain.internal.install.DefaultJavaToolchainProvisioningService.tryInstall(DefaultJavaToolchainProvisioningService.java:110)
        at org.gradle.jvm.toolchain.internal.JavaToolchainQueryService.downloadToolchain(JavaToolchainQueryService.java:178)
        ... 293 more

I use org.gradle.toolchains.foojay-resolver-convention and added it locally to your project, and then saw those SAXNotRecognizedException that led you to the right solution.

@jimshowalter
Copy link
Author

Sorry, didn't receive a notification for some reason. Will try the workaround soon.

@jimshowalter
Copy link
Author

apply plugin: 'jvm-ecosystem' didn't help.

@jimshowalter
Copy link
Author

Adding this to gradle.properties didn't help:
systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

@ben-manes
Copy link
Owner

oh well. you'd need to give us some exceptions and ideally a reproducer.

@jimshowalter
Copy link
Author

jimshowalter commented Dec 7, 2023

2023-12-07T15:09:34.115-0800 [QUIET] [system.out] Failed to determine the latest version for the following dependencies (use --info for details):
2023-12-07T15:09:34.115-0800 [QUIET] [system.out]  - ch.qos.logback:logback-classic
2023-12-07T15:09:34.115-0800 [QUIET] [system.out]      1.4.14
2023-12-07T15:09:34.115-0800 [INFO] [org.gradle.api.Project] The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve ch.qos.logback:logback-classic:+.
Required by:
    project :foo
Caused by: org.gradle.internal.component.NoMatchingGraphVariantsException: No matching variant of ch.qos.logback:logback-classic:1.4.14 was found. The consumer was configured to find a component of category 'scala-analysis' for use during 'incremental-analysis', compatible with any Java version but:
  - Variant 'compile' capability ch.qos.logback:logback-classic:1.4.14:
      - Incompatible because this component declares a library for use during compile-time and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'enforced-platform-compile' capability ch.qos.logback:logback-classic-derived-enforced-platform:1.4.14:
      - Incompatible because this component declares an enforced platform for use during compile-time and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'enforced-platform-runtime' capability ch.qos.logback:logback-classic-derived-enforced-platform:1.4.14:
      - Incompatible because this component declares an enforced platform for use during runtime and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'javadoc' capability ch.qos.logback:logback-classic:1.4.14:
      - Incompatible because this component declares documentation for use during runtime and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'platform-compile' capability ch.qos.logback:logback-classic-derived-platform:1.4.14:
      - Incompatible because this component declares a platform for use during compile-time and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'platform-runtime' capability ch.qos.logback:logback-classic-derived-platform:1.4.14:
      - Incompatible because this component declares a platform for use during runtime and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'runtime' capability ch.qos.logback:logback-classic:1.4.14:
      - Incompatible because this component declares a library for use during runtime and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
  - Variant 'sources' capability ch.qos.logback:logback-classic:1.4.14:
      - Incompatible because this component declares documentation for use during runtime and the consumer needed a component of category 'scala-analysis' for use during 'incremental-analysis'
      - Other compatible attribute:
          - Doesn't say anything about its target Java version (required compatibility with any Java version)
	at org.gradle.internal.component.ResolutionFailureHandler.noMatchingGraphVariantFailure(ResolutionFailureHandler.java:328)
	at org.gradle.internal.component.model.GraphVariantSelector.selectVariants(GraphVariantSelector.java:138)
	at org.gradle.internal.component.model.GraphVariantSelector.selectVariants(GraphVariantSelector.java:74)
	at org.gradle.internal.component.model.LocalComponentDependencyMetadata.selectVariants(LocalComponentDependencyMetadata.java:127)
	at org.gradle.internal.component.model.DelegatingDependencyMetadata.selectVariants(DelegatingDependencyMetadata.java:46)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:262)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:147)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:364)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:256)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:193)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:166)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphResolver.resolveGraph(DependencyGraphResolver.java:170)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:251)
	at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:88)
	at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:77)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:711)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:703)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphInBuildOperation(DefaultConfiguration.java:703)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusivelyIfRequired$3(DefaultConfiguration.java:695)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:504)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusivelyIfRequired(DefaultConfiguration.java:687)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:680)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:655)
	at org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
	at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.kt:56)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolve(DependencyUpdates.kt:89)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolveProjects(DependencyUpdates.kt:74)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.run(DependencyUpdates.kt:44)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask.dependencyUpdates(DependencyUpdatesTask.kt:138)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
	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.TaskExecution$3.run(TaskExecution.java:248)
	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$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:233)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:216)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:199)
	at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:166)
	at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:28)
	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.executeDelegateBroadcastingChanges(CaptureStateAfterExecutionStep.java:100)
	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:72)
	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:50)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:179)
	at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:70)
	at org.gradle.internal.Either$Right.fold(Either.java:175)
	at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:68)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:46)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:91)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:55)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:37)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:108)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:71)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:45)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNonEmptySources(SkipEmptyWorkStep.java:177)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:81)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:53)
	at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
	at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
	at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:75)
	at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:41)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:32)
	at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:293)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:21)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
	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:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
	at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)`

@jimshowalter
Copy link
Author

It's a shame gradle.org doesn't simply make update detection a native feature.

@ben-manes
Copy link
Owner

Oh, this is an issue with the scala plugin (see #816 (comment)). It appeared to me to be a Gradle bug, but rather than me trying to chase them or other plugins down to comply with the apis, you can just ignore that problematic configuration.

import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.api.specs.Spec

tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
  filterConfigurations = Spec<Configuration> {
    !it.name.startsWith("incrementalScalaAnalysis")
  }
}

It's a shame gradle.org doesn't simply make update detection a native feature.

yep, this was meant to be a weekend project that would live a few weeks or months until they added the feature themselves. Alas like all eng teams would do (hence my fault for not thinking through it), they were happy someone else took on the work and had more than enough to backlog it forever.

@jimshowalter
Copy link
Author

No good deed goes unpunished.

Currently we do our filtering like this:

` apply plugin: 'com.github.ben-manes.versions'

def isNonStable = { String version ->
    def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { keyword -> version.toUpperCase().contains(keyword) }
    def regex = /^[0-9,.v-]+(-r)?$/
    return !stableKeyword && !(version ==~ regex)
}

dependencyUpdates {
    resolutionStrategy {
        componentSelection {
            // Ignore IntelliJ warning about using "configureEach" instead of "all", because it breaks dependencyUpdates:
            all { selection ->
                if (isNonStable(selection.candidate.version) && !isNonStable(currentVersion)) {
                    reject('Release candidate')
                }
                //println("evaluating: $currentVersion => $selection.candidate.version")
            }
        }
    }
}`

How can I add filtering of incrementalScalaAnalysis to that?

@jimshowalter
Copy link
Author

When I tried the code snippet, first it complained about the import statements, and then it complained about the named field:

tasks.named < com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask > ("dependencyUpdates").configure { filterConfigurations = org.gradle.api.specs.Spec < Configuration > { !it.name.startsWith("incrementalScalaAnalysis") } }

Could not get unknown property 'named' for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.

@ben-manes
Copy link
Owner

I think in groovy it would be

tasks.named("dependencyUpdates").configure {
  filterConfigurations {
    !it.name.startsWith("incrementalScalaAnalysis")
  }
}

@jimshowalter
Copy link
Author

That was it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants