[
https://issues.apache.org/jira/browse/OOZIE-3083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16315092#comment-16315092
]
Attila Sasvari commented on OOZIE-3083:
---------------------------------------
[~gezapeti] I applied the patch, created a distro with {{bin/mkdistro.sh}} and
installed ext2.2. I can confirm that build version is displayed on the Web UI.
However, I don't like the response to request sent to "v2/admin/build-version":
{code}
curl 'http://localhost:11000/oozie/v2/admin/build-version'
{"buildVersion":"5.0.0-beta1","buildInfo":"{build.time=2018.01.07-07:18:42GMT,
vc.url=https:\/\/github.com\/apache\/oozie.git, build.user=asasvari,
vc.revision=master@dde1284, build.version=5.0.0-beta1}"}
{code}
It is not a valid JSON.
I believe ObjectMapper should be used. For example:
{code}
Map<String, Object> m = new LinkedHashMap<>();
m.put("buildVersion", BuildInfo.BUILD_VERSION);
m.put("buildInfo", BuildInfo.getBuildInfo());
ObjectMapper objectMap = new ObjectMapper() ;
try {
System.out.println(objectMap.writeValueAsString(m));
} catch (IOException e) {
e.printStackTrace();
}
{code}
would return
{code}
{"buildVersion":"build.version","buildInfo":{"build.time":"${build.time}","vc.url":"${vc.url}","build.user":"asasvari","vc.revision":"${vc.revision}","build.version":"5.0.0-beta1"}}
{code}
> Make improved version Info backward compatible
> ----------------------------------------------
>
> Key: OOZIE-3083
> URL: https://issues.apache.org/jira/browse/OOZIE-3083
> Project: Oozie
> Issue Type: Bug
> Reporter: Peter Cseh
> Assignee: Peter Cseh
> Attachments: OOZIE-3083.001.patch
>
>
> OOZIE-2004 changed the format of the version info output considerably.
> We should change it back to a more compatible format.
> It could be something like
> {code}
> {"buildVersion":"5.0.0-SNAPSHOT", "buildInfo":"{build.time=${build.time},
> vc.url=${vc.url}, build.user=asasvari, vc.revision=${vc.revision}"}
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)