Search code examples
javaspring-bootgradlewar

After upgrading to gradle 7.x generating two war files


After upgrading from gradle 5.x to 7.x, two war files generating.

Below are the 2 war file names

test-app-1.0.0.war
test-app-1.0.0-plain.war

below is gradle plugin and task used:

plugins {
    id 'war'
}

bootWar {
    launchScript()
    manifest {
        attributes 'Implementation-Version':  archiveVersion
    }
}

I want to generate only test-app-1.0.0.war. How to fix this?


Solution

  • Based on the reference plain jar - stackoverflow:

    Changed build.gradle like below

    war {
        enabled = false
    }
    
    bootWar {
        enabled = true
        launchScript()
        manifest {
            attributes 'Implementation-Version':  archiveVersion
        }
    }
    

    Now it's generating only test-app-1.0.0.war