spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Issue with Layertools in Spring Boot Project

Open river-cell opened this issue 1 year ago • 2 comments

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?

river-cell avatar Oct 14 '24 21:10 river-cell

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.

philwebb avatar Oct 15 '24 04:10 philwebb

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>

river-cell avatar Oct 16 '24 09:10 river-cell

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.

spring-projects-issues avatar Oct 23 '24 09:10 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.

spring-projects-issues avatar Oct 30 '24 09:10 spring-projects-issues