X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2Fa2%2FFsA2Source.java;h=c0e721941b1a82c8385d43c7dba170b1e5b5490e;hb=d72d4023504e3273b3b65284e4255acffd30ddfc;hp=1072a11498fdf03ab10be82df2fcf3d5086a0f0d;hpb=5f2d4436f67cae57b49e4e1535ead60394352562;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/a2/FsA2Source.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/a2/FsA2Source.java index 1072a1149..c0e721941 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/a2/FsA2Source.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/a2/FsA2Source.java @@ -43,9 +43,11 @@ public class FsA2Source extends ProvisioningSource { if (!"jar".equals(ext)) continue modules; String moduleName = moduleFileName.substring(0, lastDot); - int firstDash = moduleName.indexOf('-'); - String versionStr = moduleName.substring(firstDash + 1); - String componentName = moduleName.substring(0, firstDash); + if (moduleName.endsWith("-SNAPSHOT")) + moduleName = moduleName.substring(0, moduleName.length() - "-SNAPSHOT".length()); + int lastDash = moduleName.lastIndexOf('-'); + String versionStr = moduleName.substring(lastDash + 1); + String componentName = moduleName.substring(0, lastDash); // if(versionStr.endsWith("-SNAPSHOT")) { // versionStr = readVersionFromModule(modulePath); // } @@ -54,9 +56,12 @@ public class FsA2Source extends ProvisioningSource { version = new Version(versionStr); } catch (Exception e) { versionStr = readVersionFromModule(modulePath); - version = new Version(versionStr); - // OsgiBootUtils.debug("Ignore " + modulePath + " (" + e.getMessage() + ")"); - // continue modules; + if (versionStr != null) { + version = new Version(versionStr); + } else { + OsgiBootUtils.debug("Ignore " + modulePath + " (" + e.getMessage() + ")"); + continue modules; + } } A2Component component = contribution.getOrAddComponent(componentName); A2Module module = component.getOrAddModule(version, modulePath);