示例#1
0
 @Override
 public String toVersionRange(String version) {
   int digits = ServiceConstants.DEFAULT_VERSION_DIGITS;
   String value =
       classPathResolver.getManifestProperty(ServiceConstants.INSTR_FAB_VERSION_RANGE_DIGITS);
   if (notEmpty(value)) {
     try {
       digits = Integer.parseInt(value);
     } catch (NumberFormatException e) {
       LOG.warn(
           "Failed to parse manifest header "
               + ServiceConstants.INSTR_FAB_VERSION_RANGE_DIGITS
               + " as a number. Got: '"
               + value
               + "' so ignoring it");
     }
     if (digits < 0 || digits > 4) {
       LOG.warn(
           "Invalid value of manifest header "
               + ServiceConstants.INSTR_FAB_VERSION_RANGE_DIGITS
               + " as value "
               + digits
               + " is out of range so ignoring it");
       digits = ServiceConstants.DEFAULT_VERSION_DIGITS;
     }
   }
   return Versions.toVersionRange(version, digits);
 }
示例#2
0
 @Override
 public VersionedDependencyId getVersionedDependencyId() throws IOException {
   PomDetails pomDetails = resolvePomDetails();
   if (pomDetails == null || !pomDetails.isValid()) {
     LOG.warn("Cannot resolve pom.xml for " + getJarFile());
     return null;
   }
   model = pomDetails.getModel();
   return new VersionedDependencyId(model);
 }