When switching to Gradle 8.10.2 all war projects break

Hi,

I just tried to update from 8.2.1 to 8.10.2.
We use EAR and WAR projects and what I observe is that after switching “something” is adding the .war extension twice. Inside Eclipse (using Buildship) I see that “.war.war” is appended to each war project that is added to the EAR project. Previously, only “.war” was appended. This breaks deployment from inside the IDE when deploying to a weblogic server using the OEPE.

It is really strange to me that this is caused by the update. Is there maybe some change in the way things are communicated to Buildship in some way? I havn’t yet updated Buildship to the latest version since it is not so easy to do and it shouldn’t really be necessary (at least I did see any requirements to do so for the latest Gradle version).

How can I debug this?

All WAR projects use this piece of code:

apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
eclipse {
    project {
        buildCommand 'org.eclipse.jdt.core.javabuilder'
        natures 'org.eclipse.jdt.core.javanature',
                'org.eclipse.jem.workbench.JavaEMFNature',
                'org.eclipse.wst.common.modulecore.ModuleCoreNature',
                'org.eclipse.wst.common.project.facet.core.nature'
    }
    wtp {
        facet {
            facets = []
            facet name: 'java', version: '1.8'
            facet name: 'jst.web', version: '3.0'
        }
    }
}

The Deployment Assembly Page in Eclipse will show the “.war.war” extension being appended to the project name (which also ends in .war).

With Gradle 8.2.1 these names have one “.war” less.

Looking forward for any clues.

Thanks a lot, Thomas

Update:
Upgrading Buildship to the latest version does not improve things.

It seems that previous versions had a problem so our build scripts that create the descriptor for the EAR in Eclipse add “.war” using eclipse.wtp.component.whenMerged:

               whenMerged { wtpComponent ->
                    def modules = wtpComponent.getWbModuleEntries()
                    def toRemove = []
                    modules.each { module ->
                        if(module instanceof org.gradle.plugins.ide.eclipse.model.WbDependentModule) {
                            def archiveName = module.getArchiveName()
//                            if(archiveName.endsWith('.war')) {
//                                module.setArchiveName(module.getArchiveName() + '.war')
//                            }

This is no longer necessary. So when removing that workaround all is fine. Sorry for the confusion.

Thomas

1 Like