Skip to content

Manifest attributes cannot be resolved with the new loader implementation #38996

Closed

Description

@mnorsic

OS: Windows 11
Java version: OpenJDK 21.0.1

openjdk 21.0.1 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)

Spring Boot version: 3.2.1

After upgrade from Spring Boot 3.2.0 to 3.2.1 methods from java.util.Package are not working and are returning nulls, such as getImplementationVersion(), getImplementationVendor() and getImplementationTitle().

I have created a small example here with a REST API Controller that returns data from beforementioned methods here: https://github.com/mnorsic/manifest-example

When running application JAR from build\libs directory using Java CLI
java.exe -jar .\manifest-example-0.0.1-SNAPSHOT.jar

Spring Boot 3.2.0 returns
{"vendor":"ACME Company LLC","title":"Manifest Example","version":"0.0.1-SNAPSHOT"}
Spring Boot 3.2.1 returns
{"vendor":null,"title":null,"version":null}

Activity

  1. changed the title [-]SPring Boot 3.2.1 does not resolve MANIFEST attributes[/-] [+]Spring Boot 3.2.1 does not resolve MANIFEST attributes[/+] on Jan 4, 2024
  2. added
    status: waiting-for-triage
    on Jan 4, 2024
  3. wilkinsona commented on Jan 4, 2024

    @wilkinsona
    Member

    Thanks, @mnorsic, but I'm getting a 404 when trying to access the sample.

  4. added
    status: waiting-for-feedback
    on Jan 4, 2024
  5. Thunderforge commented on Jan 4, 2024

    @Thunderforge

    I am encountering this problem too. Reproduction steps:

    1. Download a new project from https://start.spring.io/ with all default settings
    2. In src/main/java/com/example/demo/DemoApplication, add the following to the main() method:
      System.out.println("Implementation version: " + DemoApplication.class.getPackage().getImplementationVersion());
      
    3. Run ./gradlew bootJar
    4. From the project root, run the following:
      java -jar build/libs/demo-0.0.1-SNAPSHOT.jar
      

    On Spring Boot 3.2.0, the output is:

    Implementation version: 0.0.1-SNAPSHOT
    

    But on Spring Boot 3.2.1, the output is:

    Implementation version: null
    

    The MANIFEST.MF files are identical between the two.

  6. added
    status: feedback-provided
    and removed
    status: waiting-for-feedback
    on Jan 4, 2024
  7. added
    type: regression
    and removed
    status: waiting-for-triage
    status: feedback-provided
    on Jan 4, 2024
  8. added this to the 3.2.x milestone on Jan 4, 2024
  9. philwebb commented on Jan 5, 2024

    @philwebb
    Member

    I think this regression might have been caused by f31ffbf

  10. self-assigned this
    on Jan 5, 2024
  11. mnorsic commented on Jan 5, 2024

    @mnorsic
    Author

    Thanks, @mnorsic, but I'm getting a 404 when trying to access the sample.

    Oops, my bad: project was private instead of public, I have changed it now. But I see that you managed to reproduce it anyway...

  12. voria commented on Jan 8, 2024

    @voria

    This regression also affects the banner, where application.* variables are unset.

  13. changed the title [-]Spring Boot 3.2.1 does not resolve MANIFEST attributes[/-] [+]Manifest attributes cannot be resolved with the new loader implementation[/+] on Jan 9, 2024
  14. modified the milestones: 3.2.x, 3.2.2 on Jan 9, 2024
  15. added a commit that references this issue on Jan 9, 2024
    e5f489f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: regression

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions