Add optional links to a dependency

See gh-163
This commit is contained in:
Dave Syer
2016-08-24 11:58:39 +01:00
committed by Stephane Nicoll
parent 9c7bdcc5bf
commit d8a1927a36
5 changed files with 44 additions and 1 deletions

View File

@@ -57,6 +57,9 @@ class DependencyMetadataV21JsonMapper implements DependencyMetadataJsonMapper {
if (dep.repository) {
result.repository = dep.repository
}
if (dep.links) {
result.links = dep.links
}
result
}

View File

@@ -52,6 +52,9 @@ class InitializrMetadataV21JsonMapper extends InitializrMetadataV2JsonMapper {
if (dependency.versionRange) {
content['versionRange'] = dependency.versionRange
}
if (dependency.links) {
content.links = dependency.links
}
content
}

View File

@@ -82,6 +82,10 @@ class UiController {
if (d.description) {
result.description = d.description
}
if (d.links) {
result.url = d.links[0].url
result.links = d.links
}
if (d.weight) {
result.weight = d.weight
}