Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mnorsic opened this issue Jan 4, 2024 · 5 comments
Closed
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@mnorsic
Copy link

mnorsic commented Jan 4, 2024

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}

@mnorsic mnorsic changed the title SPring Boot 3.2.1 does not resolve MANIFEST attributes Spring Boot 3.2.1 does not resolve MANIFEST attributes Jan 4, 2024
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 4, 2024
@wilkinsona
Copy link
Member

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

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jan 4, 2024
@Thunderforge
Copy link

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.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 4, 2024
@philwebb philwebb added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jan 4, 2024
@philwebb philwebb added this to the 3.2.x milestone Jan 4, 2024
@philwebb
Copy link
Member

philwebb commented Jan 5, 2024

I think this regression might have been caused by f31ffbf

@philwebb philwebb self-assigned this Jan 5, 2024
@mnorsic
Copy link
Author

mnorsic commented Jan 5, 2024

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...

@voria
Copy link

voria commented Jan 8, 2024

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

@philwebb philwebb changed the title Spring Boot 3.2.1 does not resolve MANIFEST attributes Manifest attributes cannot be resolved with the new loader implementation Jan 9, 2024
@philwebb philwebb modified the milestones: 3.2.x, 3.2.2 Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

6 participants