Exemplo n.º 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);
 }
Exemplo n.º 2
0
 protected void logFailure(Exception e) {
   LOG.error(e.getMessage());
   Throwable cause = e.getCause();
   if (cause != null && cause != e) {
     LOG.error("Caused by: " + e, e);
   }
 }
Exemplo n.º 3
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);
 }