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

Rendering ${application.version} in a custom banner does not work in 2.3.0 #21647

Closed
norman-abramovitz opened this issue Jun 2, 2020 · 6 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@norman-abramovitz
Copy link

The variable ${application.version} does not render in a customer banner file. The same file works in version 2.2.2.

The application.version and application.title variables aren't being read from META-INF/MANIFEST.MF.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 2, 2020
@mbhave
Copy link
Contributor

mbhave commented Jun 2, 2020

@norman-abramovitz Can you provide a minimal sample that we can run to reproduce the issue? It can be a link to a GitHub repository or a zip attached here.

@mbhave mbhave added the status: waiting-for-feedback We need additional information before we can continue label Jun 2, 2020
@norman-abramovitz
Copy link
Author

norman-abramovitz commented Jun 2, 2020

Hopefully, I chose a good example that shows the issue.

The application variables are not coming through.

Please be aware I had to do some markdown formatting to get the text below to display correctly.

git clone https://github.com/spring-guides/gs-spring-boot.git
cd gs-spring-boot

# create a resources directory and add the application. properties file and banner.txt

ESDIR="initial/src/main/resources"
mkdir ${RESDIR}
cat >${RESDIR}/application.properties <<-EOF
SPRING_BANNER_LOCATION=file:/banner.txt
EOF

cat >${RESDIR}/banner.txt <<-EOF
banner 4
banner 4
banner 4
banner 4
banner 4
banner 4
banner 4

Application Name : \${application.title}
Application Version : \${application.version}
Application Formatted Version : \${application.formatted-version}
Spring Boot Version : \${spring-boot.version}
Spring Boot Formatted Version : \${spring-boot.formatted-version}
EOF

cd initial
./gradlew bootRun

# kill the server after it stops outputting and scroll backward to look at the banner output
# I expected to see the application variables to have values.

@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 Jun 2, 2020
@bclozel
Copy link
Member

bclozel commented Jun 2, 2020

I've tried reproducing this by following your instructions and I'm getting:

Spring Boot 2.2.2:

banner 4
banner 4
banner 4
banner 4
banner 4
banner 4
banner 4

Application Name :
Application Version :
Application Formatted Version :
Spring Boot Version : 2.2.2.RELEASE
Spring Boot Formatted Version :  (v2.2.2.RELEASE)

Spring Boot 2.3.0:

banner 4
banner 4
banner 4
banner 4
banner 4
banner 4
banner 4

Application Name :
Application Version :
Application Formatted Version :
Spring Boot Version : 2.3.0.RELEASE
Spring Boot Formatted Version :  (v2.3.0.RELEASE)

I don't see any change in behavior here.
Note that the SPRING_BANNER_LOCATION= should use the expected properties format spring.banner.location:, and is not needed here as we're using the default value anyway.

As far as I know, the extra information in META-INF is not added by default by the Spring Boot Gradle plugin.

Adding the following in the Gradle build:

bootJar {
	manifest {
		attributes('Implementation-Title': project.name, 'Implementation-Version': project.version)
	}
}

Works for both 2.2.2 and 2.3.0:

Application Name : spring-boot
Application Version : 0.0.1-SNAPSHOT
Application Formatted Version :  (v0.0.1-SNAPSHOT)
Spring Boot Version : 2.3.0.RELEASE
Spring Boot Formatted Version :  (v2.3.0.RELEASE)

Maybe something is missing here?
Could you provide a complete project reproducing the problem? Even with a very simple application and some directions, it's really easy to forget important information as it's the case here.

@bclozel bclozel added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jun 2, 2020
@norman-abramovitz norman-abramovitz changed the title Rendering ${application.version} in a custom banner does work in 2.3.0 Rendering ${application.version} in a custom banner does not work in 2.3.0 Jun 2, 2020
@philwebb
Copy link
Member

philwebb commented Jun 5, 2020

I wonder if this one is related to #21705?

@spring-projects-issues
Copy link
Collaborator

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 spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jun 9, 2020
@norman-abramovitz
Copy link
Author

The issue was caused by changing from maven builds to gradle builds.

@philwebb philwebb added status: invalid An issue that we don't feel is valid and removed status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

5 participants