diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java b/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java index dc91a1476c..66063c8e9d 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java @@ -26,7 +26,7 @@ import java.util.regex.Pattern; public final class IntervalUtils { - private static final String PERIOD_PART_PATTERN = "[0-9]+[WwDdHhMm]"; + private static final String PERIOD_PART_PATTERN = "[0-9]+[WwDdHhMm]?"; private static final Map PART_TYPE_CONTRIBUTIONS; @@ -98,7 +98,21 @@ public final class IntervalUtils { char type = part.charAt( part.length() - 1 ); - int coefficient = Integer.parseInt( part.substring( 0, part.length() -1 ) ); + String coefficientPart; + + if( Character.isLetter(type)) + { + coefficientPart = part.substring( 0, part.length() - 1); + } + else + { + // if the interval doesn't specify a resolution, assume minutes. + coefficientPart = part; + + type = 'm'; + } + + int coefficient = Integer.parseInt( coefficientPart ); Long period = (Long) PART_TYPE_CONTRIBUTIONS.get( "" + Character.toLowerCase( type ) );