| author | thallgren | 2011-11-24 11:04:12 (EST) |
|---|---|---|
| committer | thallgren | 2011-11-24 11:04:12 (EST) |
| commit | f105ba1ab0a18ed55b9e208a05323a69c7bf8f8f (patch) (side-by-side diff) | |
| tree | c26fe881417ab516867c37dbd4f1d53ce8601bf8 | |
| parent | 6165ea694d857890b8ab9d8a8c8fc2ddeb3d08f9 (diff) | |
| download | b3-f105ba1ab0a18ed55b9e208a05323a69c7bf8f8f.zip b3-f105ba1ab0a18ed55b9e208a05323a69c7bf8f8f.tar.gz b3-f105ba1ab0a18ed55b9e208a05323a69c7bf8f8f.tar.bz2 | |
Bug 364141 - [mavenResult] Interpreting empty dependency version
| -rw-r--r-- | org.eclipse.b3.aggregator.engine.maven/src/org/eclipse/b3/aggregator/engine/maven/InstallableUnitMapping.java | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/org.eclipse.b3.aggregator.engine.maven/src/org/eclipse/b3/aggregator/engine/maven/InstallableUnitMapping.java b/org.eclipse.b3.aggregator.engine.maven/src/org/eclipse/b3/aggregator/engine/maven/InstallableUnitMapping.java index 0089c47..8aee2b5 100644 --- a/org.eclipse.b3.aggregator.engine.maven/src/org/eclipse/b3/aggregator/engine/maven/InstallableUnitMapping.java +++ b/org.eclipse.b3.aggregator.engine.maven/src/org/eclipse/b3/aggregator/engine/maven/InstallableUnitMapping.java @@ -231,6 +231,9 @@ public class InstallableUnitMapping implements IInstallableUnit { dependency.setVersion(versionRangeString.toString());
}
+ else {
+ dependency.setVersion("[0.0,)");
+ }
if(cap.getMin() == 0)
dependency.setOptional(true);
@@ -309,6 +312,26 @@ public class InstallableUnitMapping implements IInstallableUnit { return installableUnit.compareTo(other);
}
+ private String extractProperty(Map<String, String> iuProperties, String key) {
+ String value = iuProperties.remove(key);
+
+ if(value != null) {
+ if(value.startsWith("%")) {
+ String localizedKey = "df_LT." + value.substring(1);
+ String localizedValue = iuProperties.remove(localizedKey);
+
+ if(localizedValue != null)
+ value = localizedValue;
+ }
+ }
+
+ return trimOrNull(value);
+ }
+
+ private String getArtifactFileName() throws CoreException {
+ return getFileName(null);
+ }
+
public Collection<IArtifactKey> getArtifacts() {
return installableUnit.getArtifacts();
}
@@ -329,6 +352,25 @@ public class InstallableUnitMapping implements IInstallableUnit { return installableUnit.getCopyright(locale);
}
+ private String getFileName(String extension) throws CoreException {
+ String fileId = getId();
+ StringBuilder fileName = new StringBuilder(fileId);
+ fileName.append('-');
+ fileName.append(getVersionString());
+
+ if(extension == null) {
+ if(!(getMainArtifact() != null && "binary".equals(getMainArtifact().getClassifier()))) {
+ fileName.append(".jar");
+ }
+ }
+ else {
+ fileName.append('.');
+ fileName.append(extension);
+ }
+
+ return fileName.toString();
+ }
+
public IMatchExpression<IInstallableUnit> getFilter() {
return installableUnit.getFilter();
}
@@ -468,49 +510,6 @@ public class InstallableUnitMapping implements IInstallableUnit { transientFlag = isTransient;
}
- public IInstallableUnit unresolved() {
- return installableUnit.unresolved();
- }
-
- private String extractProperty(Map<String, String> iuProperties, String key) {
- String value = iuProperties.remove(key);
-
- if(value != null) {
- if(value.startsWith("%")) {
- String localizedKey = "df_LT." + value.substring(1);
- String localizedValue = iuProperties.remove(localizedKey);
-
- if(localizedValue != null)
- value = localizedValue;
- }
- }
-
- return trimOrNull(value);
- }
-
- private String getArtifactFileName() throws CoreException {
- return getFileName(null);
- }
-
- private String getFileName(String extension) throws CoreException {
- String fileId = getId();
- StringBuilder fileName = new StringBuilder(fileId);
- fileName.append('-');
- fileName.append(getVersionString());
-
- if(extension == null) {
- if(!(getMainArtifact() != null && "binary".equals(getMainArtifact().getClassifier()))) {
- fileName.append(".jar");
- }
- }
- else {
- fileName.append('.');
- fileName.append(extension);
- }
-
- return fileName.toString();
- }
-
private String trimOrNull(String value) {
if(value != null) {
value = value.trim();
@@ -519,4 +518,8 @@ public class InstallableUnitMapping implements IInstallableUnit { }
return value;
}
+
+ public IInstallableUnit unresolved() {
+ return installableUnit.unresolved();
+ }
}
|

