DRYing the webjars versions in leaf projects #139
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi guys,
thanks for your great job at explaining me what this Spring Boot + AngulasJS was all about!
I felt I could pay you back with a little help: DRYing webjars versions.
Indeed, first version of the tutorial shows a nice mechanism to filter properties in wro4J file but the Github version gets rid of that nice feature, probably to correct previous compatibility issues with bootstrap CSS files.
In this pull request, I suggest creating jquery, bootstrap and AngularJS versions in one place, Maven properties, and then take advantage of the neat Spring filtering @variable@ to inject versions.
This way, versions for webjars are defined once and for all, and injected magically by Spring.
And my IntelliJ IDEA now can resolve the CSS and JS files since they are present in the generated-resources folder! (makes me happy when IntelliJ stops complaining)
Some notes about the correction:
1- Some wro.xml files were not processing the main.less file since there was still the @project.basedir@ mention in it
2- I fought myself not to promote the properties to the root pom.xml (I guess it was more convenient for tutorial scoping/chunking to have it defined in leaf projects)
3- I changed the Wro configuration folder to become the ${project.build.directory}/wro since once the resources plugin kicks in, we have everything filtered there.
Hope this helps you keeping up with your good work.
Thanks again!