I have upgraded my project from JDK 8 to JDK 17 and from Gradle 4 to Gradle 7.
I am able to build war properly in my local and able to run the application but while doing publish war to Artifactory I do not see complete files chunks which i used to see with gradle 4 and below errors are visible in log .
Below is publishing task definition :
publishing {
publications {
product(MavenPublication) {
artifactId "$project.name"
artifact war
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compileClasspath.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
Plugin used
plugins {
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'java'
id 'war'
id 'idea'
id 'eclipse'
}
Error :
> Task :project.package:publishProductPublicationToArtifactoryRepository
Execution optimizations have been disabled for task ':project.package:publishProductPublicationToArtifactoryRepository' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'project-name-1.3.18-SNAPSHOT.war'. Reason: Task ':project.package:publishProductPublicationToArtifactoryRepository' uses this output of task ':project.package:bootWar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Cannot upload checksum for snapshot-maven-metadata.xml because the remote repository doesn't support SHA-512. This will not fail the build.
Cannot upload checksum for module-maven-metadata.xml because the remote repository doesn't support SHA-512. This will not fail the build.
Finally I got the solution , below are required changes in publishing task
publications {
product(MavenPublication) {
artifactId "$project.name"
artifact bootWar