mvnd fails when version range is used in extensions.xml, fixes #275

This commit is contained in:
Guillaume Nodet
2020-12-18 08:38:24 +01:00
parent 6ca5d77402
commit 1302ab3a28
4 changed files with 4 additions and 4 deletions

View File

@@ -361,7 +361,7 @@ public class DaemonParameters {
List<String> extensions = readCoreExtensionsDescriptor(multiModuleProjectDirectory()).stream() List<String> extensions = readCoreExtensionsDescriptor(multiModuleProjectDirectory()).stream()
.map(e -> e.getGroupId() + ":" + e.getArtifactId() + ":" + e.getVersion()) .map(e -> e.getGroupId() + ":" + e.getArtifactId() + ":" + e.getVersion())
.collect(Collectors.toList()); .collect(Collectors.toList());
return String.join(",", extensions); return String.join(";", extensions);
} catch (IOException | XmlPullParserException e) { } catch (IOException | XmlPullParserException e) {
throw new RuntimeException("Unable to parse core extensions", e); throw new RuntimeException("Unable to parse core extensions", e);
} }

View File

@@ -439,7 +439,7 @@ public class DaemonMavenCli {
CoreExtensionEntry coreEntry = CoreExtensionEntry.discoverFrom(coreRealm); CoreExtensionEntry coreEntry = CoreExtensionEntry.discoverFrom(coreRealm);
List<CoreExtension> extensions = Stream List<CoreExtension> extensions = Stream
.of(Environment.MVND_CORE_EXTENSIONS.asString().split(",")) .of(Environment.MVND_CORE_EXTENSIONS.asString().split(";"))
.filter(s -> s != null && !s.isEmpty()) .filter(s -> s != null && !s.isEmpty())
.map(s -> { .map(s -> {
String[] parts = s.split(":"); String[] parts = s.split(":");

View File

@@ -49,7 +49,7 @@ public class ExtensionsNativeIT {
client.execute(o, "-v").assertSuccess(); client.execute(o, "-v").assertSuccess();
assertDaemonRegistrySize(1); assertDaemonRegistrySize(1);
DaemonInfo daemon = registry.getAll().iterator().next(); DaemonInfo daemon = registry.getAll().iterator().next();
assertTrue(daemon.getOptions().contains("mvnd.coreExtensions=io.takari.aether:takari-local-repository:0.11.3")); assertTrue(daemon.getOptions().contains("mvnd.coreExtensions=io.takari.aether:takari-local-repository:[0.11.3,)"));
registry.awaitIdle(daemon.getUid()); registry.awaitIdle(daemon.getUid());

View File

@@ -20,6 +20,6 @@
<extension> <extension>
<groupId>io.takari.aether</groupId> <groupId>io.takari.aether</groupId>
<artifactId>takari-local-repository</artifactId> <artifactId>takari-local-repository</artifactId>
<version>0.11.3</version> <version>[0.11.3,)</version>
</extension> </extension>
</extensions> </extensions>