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

publishPluginJar task dependency error when publishing to custom repositories #534

Open
goncaloribeiro-rogers opened this issue Jan 2, 2024 · 0 comments

Comments

@goncaloribeiro-rogers
Copy link

When using a task publishMainPublicationToArtifactoryRepository to publish artifacts to a custom repository, the publish step is throwing the error “ Reason: Task ':publishMainPublicationToArtifactoryRepository' uses this output of task ':publishPluginJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are

A workaround was to add the following code to my build.gradle file:
afterEvaluate{ def publishPluginJar = tasks.findByName('publishPluginJar') def publishMainPublicationToArtifactoryRepository = tasks.findByName('publishMainPublicationToArtifactoryRepository') publishMainPublicationToArtifactoryRepository.dependsOn(publishPluginJar) }

Basically this code is defining the dependency between the two tasks.

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

1 participant