|
6 | 6 |
|
7 | 7 | import java.io.File;
|
8 | 8 | import java.util.Date;
|
| 9 | +import java.util.HashMap; |
9 | 10 | import java.util.List;
|
10 | 11 | import java.util.Map;
|
11 |
| -import java.util.HashMap; |
12 | 12 | import org.apache.maven.plugin.AbstractMojo;
|
13 | 13 | import org.apache.maven.plugin.MojoExecutionException;
|
14 | 14 | import org.apache.maven.plugins.annotations.Mojo;
|
@@ -37,7 +37,7 @@ public class GitChangelogMojo extends AbstractMojo {
|
37 | 37 | @Parameter(property = "extendedVariables", required = false)
|
38 | 38 | private Map extendedVariables;
|
39 | 39 |
|
40 |
| - //map variables cannot be passed through maven cli use this property as a workaround |
| 40 | + // map variables cannot be passed through maven cli use this property as a workaround |
41 | 41 | @Parameter(property = "extendedVariablesCli", required = false)
|
42 | 42 | private String[] extendedVariablesCli;
|
43 | 43 |
|
@@ -141,7 +141,7 @@ public void execute() throws MojoExecutionException {
|
141 | 141 | return;
|
142 | 142 | }
|
143 | 143 | try {
|
144 |
| - Map<String,String> extendedVariablesCliAsMap = this.convertExtendedVariablesCli2Map(); |
| 144 | + Map<String, String> extendedVariablesCliAsMap = this.convertExtendedVariablesCli2Map(); |
145 | 145 | this.extendedVariables.putAll(extendedVariablesCliAsMap);
|
146 | 146 |
|
147 | 147 | GitChangelogApi builder;
|
@@ -283,16 +283,14 @@ private boolean isSupplied(final Map<?, ?> parameter) {
|
283 | 283 | }
|
284 | 284 |
|
285 | 285 | private Map<String, String> convertExtendedVariablesCli2Map() {
|
286 |
| - Map<String, String> map = new HashMap<>(); |
287 |
| - if (this.extendedVariablesCli != null) { |
288 |
| - for (int i=0;i< this.extendedVariablesCli.length;i++) { |
289 |
| - String entry = this.extendedVariablesCli[i]; |
290 |
| - int equalsPosition = entry.indexOf( "=" ); |
291 |
| - map.put( |
292 |
| - entry.substring( 0, equalsPosition ), |
293 |
| - entry.substring( equalsPosition + 1 ) ); |
294 |
| - } |
295 |
| - } |
296 |
| - return map; |
| 286 | + Map<String, String> map = new HashMap<>(); |
| 287 | + if (this.extendedVariablesCli != null) { |
| 288 | + for (int i = 0; i < this.extendedVariablesCli.length; i++) { |
| 289 | + String entry = this.extendedVariablesCli[i]; |
| 290 | + int equalsPosition = entry.indexOf("="); |
| 291 | + map.put(entry.substring(0, equalsPosition), entry.substring(equalsPosition + 1)); |
| 292 | + } |
| 293 | + } |
| 294 | + return map; |
297 | 295 | }
|
298 | 296 | }
|
0 commit comments