Generated publish task not declaring output

I’m trying to publish a version of a project to a “maven repo project” at gitlab. I own both gitlab projects. I’m surprised by the log entry from “gradle publish”

2022-03-16T11:57:47.985-0600 [INFO] [org.gradle.internal.execution.steps.SkipUpToDateStep] Task ‘:publishMavenPublicationToJpsgcsRepository’ is not up-to-date because:
Task has not declared any outputs despite executing actions.

Then the publish ultimately fails with

2022-03-16T11:57:49.198-0600 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2022-03-16T11:57:49.198-0600 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2022-03-16T11:57:49.198-0600 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2022-03-16T11:57:49.198-0600 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ‘:publishMavenPublicationToJpsgcsRepository’.
2022-03-16T11:57:49.198-0600 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to publish publication ‘maven’ to repository ‘jpsgcs’
2022-03-16T11:57:49.198-0600 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not PUT ‘https://gitlab.com/camplab/api/v4/projects/34294364/packages/maven/jpsgcs/jpsgcs/3.3.2-1/jpsgcs-3.3.2-1.jar’. Received status code 422 from server: Unprocessable Entity

What output would you expect?
The actual output is state on an external service.
That is nothing Gradle could possible track any way.
Actually the only outputs supported currently are local file outputs.
You could set outputs.upToDateWhen { true } on that task to make it assume its outputs are always up to date and it only runs if the inputs changed if that is the correct way for your concrete use-case.

The phrasing of the message implies to me that the task should declare outputs but of course the task isn’t really mine to alter/fix. I guess I should be ignoring this INFO report. It’s certainly not the reason for my topic. Are you saying I cannot “PUT” to a gitlab repo (or anywhere other than local)? Everything about the URL looks correct to me, or at least believable.

The phrasing of the message just tells you why the task is not up-to-date.
And in this case why the task will never be up-to-date.
It just means that the task will actually be executed every time you execute it.
This can indeed be the correct behavior for a task.

The URL does not look right for me actually.
It has /api/ in it, so more looks like an API URL and not like a Maven repository URL to which you can publish, but I never worked with GitLab packages, not even knew it exists, as I don’t really like the look and feel of GitLab, so I avoid it where I can. :slight_smile:

Ok, according to Maven packages in the Package Repository | GitLab that indeed is the URL to publish to

Ok. Thanks for the confirmation. I’ll resume digging at the gitlab end. Also thank you for the explanation of the message. Most helpful