You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement: Add configuration metadata for Spring Boot application properties #475
For Simple Java Mail on the other hand, this doesn't work and IntelliJ shows an error about unresolvable configuration properties for all the application properties introduced by the Spring module of Simple Java Mail:
At first I thought that only the automatic metadata generation depends on Spring Boot, but now my understanding is that the whole configuration metadata feature is Spring Boot only. So, I guess, turning the module into a Spring Boot project would really be the only way to get IDE support for the Simple Java Mail application properties.
I understand that this might constitute a rather significant design change to the module which could have implications I can't assess appropriately.
Do we have quantitative data to support this decision? Specifically, do we have data on the ratio of Spring vs. Spring Boot users? Also, is it possible for a Spring Boot compatible project to maintain backward compatibility with Spring?
I would be willing to looking into converting this module, but not if I exclude an audience in doing so. However, another option could be to have a new module: the Simple Java Mail spring-boot-module.
I found a way to do this with build-time-only Spring boot dependency to generate the file. However, to make this work I need to define a property structure in Java that conforms to the existing property list. This is not possible however.
For example, there is a property that ends in ".class", which is impossible to model in a Java class, since it is both a reserved keyword and existing method (.getClass()) that is final. Another issue is that the existing properties uses a property name both as a property key/value as well as nested properties list, for example: .poolsize= and .poolsize.keepalivetime=. This cannot be modeled in a java class, as you can't have two fields with the same name.
I'm not sure how to proceed with this, but right now it's taking too much time.
Ok, I've jumped through a bunch of hoops to make this work. There were a few properties that contained underscores that are dashes with Spring Boot and two related properties (poolsize and poolsize.keepalivetime) that had to have an overloaded name (poolsize and poolsize-more.keepalivetime).
I pushed it to develop, so the generated spring-module dependency now contains a populated spring-configuration-metadata.json. Here's an updated spring-module jar, are you in a position to test this?
changed the title [-]Add configuration metadata for Spring Boot application properties[/-][+]Enhancement: Add configuration metadata for Spring Boot application properties[/+]on Oct 9, 2023
Activity
bbottema commentedon Oct 8, 2023
Do we have quantitative data to support this decision? Specifically, do we have data on the ratio of Spring vs. Spring Boot users? Also, is it possible for a Spring Boot compatible project to maintain backward compatibility with Spring?
I would be willing to looking into converting this module, but not if I exclude an audience in doing so. However, another option could be to have a new module: the Simple Java Mail spring-boot-module.
bbottema commentedon Oct 8, 2023
I found a way to do this with build-time-only Spring boot dependency to generate the file. However, to make this work I need to define a property structure in Java that conforms to the existing property list. This is not possible however.
For example, there is a property that ends in ".class", which is impossible to model in a Java class, since it is both a reserved keyword and existing method (
.getClass()) that is final. Another issue is that the existing properties uses a property name both as a property key/value as well as nested properties list, for example:.poolsize=and.poolsize.keepalivetime=. This cannot be modeled in a java class, as you can't have two fields with the same name.I'm not sure how to proceed with this, but right now it's taking too much time.
#475: Added Spring Boot support in the sense that we now generate a s…
#475: Added missing property that was modified (overloaded) to work w…
bbottema commentedon Oct 8, 2023
Ok, I've jumped through a bunch of hoops to make this work. There were a few properties that contained underscores that are dashes with Spring Boot and two related properties (poolsize and poolsize.keepalivetime) that had to have an overloaded name (poolsize and poolsize-more.keepalivetime).
I pushed it to develop, so the generated spring-module dependency now contains a populated spring-configuration-metadata.json. Here's an updated spring-module jar, are you in a position to test this?
spring-module dependency + docs.zip
moritzreiter commentedon Oct 9, 2023
Wow, I'm a bit shocked by how you managed to provide a working solution for this within hours! 😀
I downloaded the JAR and added it to the classpath in my project and it seems to work great:
This whole project is really great work, thanks so much for sharing it!
bbottema commentedon Oct 9, 2023
Well, ChatGPT helped me out a lot with this. He really changed how I work and study!
[-]Add configuration metadata for Spring Boot application properties[/-][+]Enhancement: Add configuration metadata for Spring Boot application properties[/+]bbottema commentedon Oct 9, 2023
Thank for testing! Enhancement released in 8.3.0.