Skip to content

Add support for creating layered war files with Maven #22821

@hudi1

Description

@hudi1

Repackaging application with layer=WAR:

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <layout>WAR</layout>
                <layers>
                    <enabled>true</enabled>
                </layers>
            </configuration>
        </plugin>

throws Exception:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.2.RELEASE:repackage (repackage) on project rob-oro: A type incompatibility occurred while executing org.springframework.boot:spring-boot-maven-plugin:2.3.2.RELEASE:repackage: class org.springframework.boot.loader.tools.Layouts$War cannot be cast to class org.springframework.boot.loader.tools.RepackagingLayout (org.springframework.boot.loader.tools.Layouts$War and org.springframework.boot.loader.tools.RepackagingLayout are in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @5b1f0f26)

JAR layout is working. I think WAR layout should also implement RepackagingLayout:

public static class Layouts.War extends Object implements Layout

public static class Layouts.Jar extends Object implements RepackagingLayout

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions