Gradle 5.3-rc-1 is now available for testing


(Daniel Lacasse) #1

Gradle 5.3 RC1 is available for testing; see the release notes.


(Daniel Lacasse) made this a banner . It will appear at the top of every page until it is dismissed by the user. #2

(Stephen Friedrich) #3

This is what happens when I try to update:

> ./gradlew wrapper --gradle-version=5.3-rc-1
Downloading https://services.gradle.org/distributions/gradle-5.3-RC-1-all.zip

Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle.org/distributions/gradle-5.3-RC-1-all.zip
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:67)
        at org.gradle.wrapper.Download.download(Download.java:52)
        at org.gradle.wrapper.Install$1.call(Install.java:62)
        at org.gradle.wrapper.Install$1.call(Install.java:48)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
        at org.gradle.wrapper.Install.createDist(Install.java:48)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:62)

Any idea? It may be our corporate artifactory that misses a mirror or something.


(Stefan Wolf) #4

Hi Stephen,

Looks like the version uses an uppercase RC instead of rc. Did you put that URL manually somewhere?

Cheers,
Stefan


(Stephen Friedrich) #5

Thanks a lot for the fast answer!
Stupid me. I typed it wrong initially, then tried with correct lowercase rc, but it still failed.
I did a hard git reset on the project and now it works.


(Guy Brand) removed this banner . It will no longer appear at the top of every page. #6

(idlsoft) #7

I’m getting an exception with 5.3-rc-1.
It happens while publishing an additional artifact of type ‘scripts’, which was added with this code:

project.artifacts(ah -> ah.add(JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME, archiveTask, pa -> pa.setType("scripts")));

5.2.1 Works fine.

Here is the stacktrace:

    * What went wrong:
Execution failed for task ':project_name:publishMainPublicationToIvyRepository'.
> Failed to publish publication 'main' to repository 'ivy'
   > Invalid publication 'main': multiple artifacts with the identical name, extension, type and classifier ('project_name', zip', 'scripts', 'scripts').

* 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 ':project_name:publishMainPublicationToIvyRepository'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:121)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:117)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:184)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ResolveIncrementalChangesTaskExecuter.execute(ResolveIncrementalChangesTaskExecuter.java:84)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:92)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
        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:63)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:46)
        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:46)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.artifacts.PublishException: Failed to publish publication 'main' to repository 'ivy'
        at org.gradle.api.publish.internal.PublishOperation.run(PublishOperation.java:38)
        at org.gradle.api.publish.ivy.tasks.PublishToIvyRepository.doPublish(PublishToIvyRepository.java:152)
        at org.gradle.api.publish.ivy.tasks.PublishToIvyRepository.publish(PublishToIvyRepository.java:136)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:701)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:668)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$4.run(ExecuteActionsTaskExecuter.java:337)
        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:326)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:311)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:75)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:158)
        at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:46)
        at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
        at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
        at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
        at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
        at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:49)
        at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:42)
        at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:28)
        at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:136)
        at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:60)
        at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:37)
        at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
        at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
        at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:95)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:88)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:109)
        ... 37 more
Caused by: org.gradle.api.publish.ivy.InvalidIvyPublicationException: Invalid publication 'main': multiple artifacts with the identical name, extension, type and classifier ('project_name', zip', 'scripts', 'scripts').
        at org.gradle.api.publish.ivy.internal.publisher.ValidatingIvyPublisher.checkNotDuplicate(ValidatingIvyPublisher.java:129)
        at org.gradle.api.publish.ivy.internal.publisher.ValidatingIvyPublisher.checkNoDuplicateArtifacts(ValidatingIvyPublisher.java:114)
        at org.gradle.api.publish.ivy.internal.publisher.ValidatingIvyPublisher.publish(ValidatingIvyPublisher.java:54)
        at org.gradle.api.publish.ivy.internal.publisher.ContextualizingIvyPublisher$1.execute(ContextualizingIvyPublisher.java:36)
        at org.gradle.api.publish.ivy.internal.publisher.ContextualizingIvyPublisher$1.execute(ContextualizingIvyPublisher.java:34)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:133)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:63)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:41)
        at org.gradle.api.publish.ivy.internal.publisher.ContextualizingIvyPublisher.publish(ContextualizingIvyPublisher.java:34)
        at org.gradle.api.publish.ivy.tasks.PublishToIvyRepository$2.publish(PublishToIvyRepository.java:150)
        at org.gradle.api.publish.internal.PublishOperation.run(PublishOperation.java:36)
        ... 77 more

Gradle 5.3-rc-2 is now available for testing
(Daniel Lacasse) #8

@idlsoft Could you open an issue on gradle/gradle board with a reproducible example?


(Louis Jacomet) #9

Hello,

I tried reproducing this problem.

However with the following code:

plugins {
    // Apply the java-library plugin to add support for Java Library
    `java-library`
    `ivy-publish`
}

group = "org.test"
version = "0.1.0"

repositories {
    jcenter()
}

dependencies {
    api("org.apache.commons:commons-math3:3.6.1")
    implementation("com.google.guava:guava:27.0.1-jre")
    testImplementation("junit:junit:4.12")
}

tasks.create<Zip>("scriptsArchive") {
    destinationDirectory.set(file("$buildDir/scripts"))
    from("$projectDir/src/test")
}

artifacts {
    add(JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME, tasks.getByPath("scriptsArchive")) {
        setType("scripts")
    }
}

publishing {
    publications {
        create<IvyPublication>("ivy") {
            from(components["java"])
        }
    }

    repositories {
        ivy {
            url = uri("$projectDir/repo")
        }
    }
}

the only thing I can observe is that with Gradle 5.2.1 the additional artifact is not published and with Gradle 5.3 RC 1 or 2 the additional artifact is published.
If I duplicate the add line, then Gradle 5.3 outputs an error similar to the one reported.

This leads me to conclude that you have somewhat a double addition in your project and the project is not publishing as expected. And that Gradle 5.3 by fixing the publication issue fails on the double addition.

Without more information to revise this analysis, I do not think there is a regression in 5.3, quite the opposite, a pattern that should work now does.


(idlsoft) #10

You’re right.
I had code added to make publishing work back in the 4.x days.
I created a sample project here https://github.com/idlsoft/gradle-publish-bug
It works in 5.2.1, but not 5.3
If you remove the lines 15-21 from build.gradle it won’t publish sources under 5.2.1, but will work fine in 5.3.
So it looks like a bug has been fixed, but it breaks workarounds people might have.