WIP - Fix #252 - Add "About" menu with Maven version numbers #84
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.
PR by barbeau
Apr 18, 2018
Originally opened as CUTR-at-USF#327
Closes #52
Summary:
This is initial work towards building an API that exposes Maven version information for the project and showing this info when the user clicks on the "About" link in the webapp page header.
Details:
Uses
buildnumber-maven-plugin
to get the Git version umber andtemplating-maven-plugin
to generate a class that has the Maven version and artifact info (VersionUtil
) (see https://stackoverflow.com/a/36628755/937715)Problems:
templating-maven-plugin
doesn't play well with IntelliJ. In other words, the project will fail to build in IntelliJ when you check it out because IntelliJ can't find theVersionUtil
class. See this IntelliJ issue for implemementing support fortemplating-maven-plugin
- https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FIDEA-161010 . The current workaround is to build the project via Maven at the commandline first usingmvn install
, and then IntelliJ will recognize the class.VersionApi.getVersion()
doesn't seem to return the JSON version of the VersionModel when you return just the object (I get an empty response). Not sure why this isn't working. Other option is to return a String from this method and serialize to JSON using JacksonObjectMapper
directly.TODO:
Version
withVersionModel
(after the model class). This needs to be reverted.templating-maven-plugin
can be made compatible with IntelliJ. If not, we may need to switch to another method for getting Maven version information at runtime.