Skip to content

Conversation

@anthonydahanne
Copy link
Contributor

No description provided.

* that could provoke issues with projects including cf-env with the error `'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-test:jar is missing. in io.pivotal.cfenv:java-cfenv:3.1.0`
`
* so that when you add it to an app, it will add the `cloud` profile to it, similar to Spring Auto Reconfiguration
@anthonydahanne
Copy link
Contributor Author

Ready to go!
I tested it with spring-music no cfenv and JBP

   2023-09-13T17:01:18.02-0400 [APP/PROC/WEB/0] OUT :: Spring Boot ::                (v3.1.3)
   2023-09-13T17:01:18.17-0400 [APP/PROC/WEB/0] OUT 2023-09-13T21:01:18.170Z  INFO 7 --- [           main] o.c.samples.music.Application            : Starting Application v1.0 using Java 17.0.8 with PID 7 (/home/vcap/app/BOOT-INF/classes started by vcap in /home/vcap/app)
   2023-09-13T17:01:18.17-0400 [APP/PROC/WEB/0] OUT 2023-09-13T21:01:18.179Z  INFO 7 --- [           main] o.c.samples.music.Application            : The following 2 profiles are active: "cloud", "http2"
   2023-09-13T17:01:18.33-0400 [APP/PROC/WEB/0] OUT 2023-09-13T21:01:18.335Z  INFO 7 --- [           main] i.p.c.p.CloudProfileApplicationListener  : 'cloud' profile activated
   2023-09-13T17:01:18.33-0400 [APP/PROC/WEB/0] OUT 2023-09-13T21:01:18.337Z  INFO 7 --- [           main] s.b.CfDataSourceEnvironmentPostProcessor : Setting spring.datasource properties from bound service [mysql-service]

@pivotal-david-osullivan pivotal-david-osullivan merged commit b161c4e into pivotal-cf:main Sep 14, 2023
@anthonydahanne anthonydahanne deleted the cloud-profile branch September 14, 2023 12:50
@massiinthesea
Copy link

massiinthesea commented Sep 21, 2023

Hello,

With this new version, the "cloud" profile is systematically added.

In older versions, it was removed with this option in the manifest.
JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{ enabled: false }'

Now, this function doesn't seem to remove the profile, and this is causing me problems. Would you have a solution for removing it in this new buildpack version?

Thank you very much.

@craig41
Copy link

craig41 commented Jul 24, 2024

hello,

this appears to be causing applications that utilize this package to launch under the cloud profile always. was this the intended behavior?

@anthonydahanne
Copy link
Contributor Author

hello @craig41 , @massiinthesea - yes the idea is to fill the gap with Spring Auto Reconfiguration, the former library, that injected this profile automatically.

In older versions, it was removed with this option in the manifest.
JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{ enabled: false }'

That option disables the injection of the Spring Auto Reconfiguration library.

If you don't want java-cf-env to be injected by the Java Buildpack in CF, you can disable this behavior - the same you could do with SAR:

JBP_CONFIG_JAVA_CF_ENV: '{enabled: false}'

Finally, if you still want to have java-cf-env in your classpath, but not the cloud profile, you can add this dependency to your pom, it will not get the cloud profile setter (which only exists in java-cf-env-all)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants