Hello,

I'm experiencing an issue with the layertools feature in my Spring Boot project. Below is the relevant section of my pom.xml for the Spring Boot Maven plugin:

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

I'm using Spring Boot version 3.2.4.

While trying to list the layers using the following commands: java -Djarmode=tools -jar my_app.jar list-layers or java -Djarmode=layertools -jar my_app.jar list It is applicable also to other arguments f.e. extract

the application runs as if the -Djarmode options are not being applied, instead of listing the layers.

I have checked various resources and followed the recommended configurations, but I still face this issue.

Could you please assist me in resolving this?

Comment From: philwebb

I'm afraid there's not enough information in this report to help you. Please start by upgrading to the latest 3.2.x version (3.2.10 at the time of writing this comment). If that doesn't work, please provide a sample application that reproduces the problem.

Comment From: river-cell

I saw that problem occurs because layers aren't generated in MANIFEST file, somehow I read that problem may be related to those plugins

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <compress>true</compress>
                        <index>false</index>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                            <useUniqueVersions>false</useUniqueVersions>
                            <mainClass>path.to.Launcher</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <layers>
                        <enabled>true</enabled>
                    </layers>
                </configuration>
            </plugin>

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.