Skip to content

Commit

Permalink
Backward compatibility for content selectors (#248)
Browse files Browse the repository at this point in the history
Fixes #242
  • Loading branch information
zeitounator authored Feb 20, 2020
1 parent 63f74b6 commit 56f2d1d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions files/groovy/create_content_selector.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ SelectorConfiguration selectorConfig = selectorManager.browse().find { it -> it.

if (selectorConfig == null) {
update = false
selectorConfig = selectorManager.newSelectorConfiguration()
selectorConfig.setName(parsed_args.name)
try {
selectorConfig = selectorManager.newSelectorConfiguration()
selectorConfig.setName(parsed_args.name)
} catch (MissingMethodException) {
// Compatibility with nexus versions older than 3.20
selectorConfig = new SelectorConfiguration('name': parsed_args.name)
}
}

selectorConfig.setDescription(parsed_args.description)
Expand Down

0 comments on commit 56f2d1d

Please sign in to comment.