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 and templating-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 the VersionUtil class. See this IntelliJ issue for implemementing support for templating-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 using mvn 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 Jackson ObjectMapper directly.
TODO:
[x] Looks like Find & Replace replaced all the version comment header Version with VersionModel (after the model class). This needs to be reverted.
[ ] Determine if 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.
PR by barbeau Apr 18, 2018 Originally opened as https://github.com/CUTR-at-USF/gtfs-realtime-validator/pull/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.