Skip to content

Commit

Permalink
[template] fix NPE when resolving templates from catalog. Fixes #560
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Nov 30, 2021
1 parent 5e6bdd0 commit d05add2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-SNAPSHOT
0.9.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Properties;

import static org.jreleaser.util.StringUtils.isBlank;
import static org.jreleaser.util.StringUtils.isNotBlank;

/**
* @author Andres Almiray
Expand Down Expand Up @@ -135,8 +136,10 @@ public static Map<String, Reader> resolveTemplates(JReleaserLogger logger, Strin
values = TEMPLATES_INVENTORY.getProperty(templatePrefix);
}

for (String k : values.split(",")) {
templates.put(k, resolveTemplate(logger, distributionTypeName + "/" + toolName.toLowerCase() + "/" + k));
if (isNotBlank(values)) {
for (String k : values.split(",")) {
templates.put(k, resolveTemplate(logger, distributionTypeName + "/" + toolName.toLowerCase() + "/" + k));
}
}

return templates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/**
* @author Andres Almiray
* @since 1.0.0
* @since 0.9.1
*/
public class CalVer implements Comparable<CalVer> {
private static final Map<String, String> PATTERNS = new LinkedHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/**
* @author Andres Almiray
* @since 1.0.0
* @since 0.9.1
*/
public class CalVerTest {
@ParameterizedTest
Expand Down
2 changes: 1 addition & 1 deletion plugins/jdks-maven-plugin/jdks-maven-plugin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config {
}

mavenPlugin {
helpMojoPackage = 'org.jreleaser.maven.plugin'
helpMojoPackage = 'org.jreleaser.jdks.maven.plugin.help'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config {
}

mavenPlugin {
helpMojoPackage = 'org.jreleaser.maven.plugin'
helpMojoPackage = 'org.jreleaser.maven.plugin.help'
}

dependencies {
Expand Down

0 comments on commit d05add2

Please sign in to comment.