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.
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.