Skip to content

Commit b71bae6

Browse files
committed
Fix for automatic modules
1 parent 0d5b348 commit b71bae6

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.bach/src/run.bach/run/demo/MaveniverseDemo.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@
66
public class MaveniverseDemo {
77
final List<ModuleLookup> lookups =
88
List.of(
9-
ModuleLookup.ofJUnit("6.1.0-SNAPSHOT"),
9+
// JitPack GAV - https://docs.jitpack.io/intro/#building-with-jitpack
10+
// ModuleLookup.of("junit-start", "experiments~junit-onramp-SNAPSHOT")
11+
// .withRepository("https://jitpack.io")
12+
// .withBill("com.github.junit-team.junit-framework:junit-bom:{{version}}")
13+
// .withRoot("com.github.junit-team.junit-framework:junit-start")
14+
// Special Snowflake
15+
ModuleLookup.of("junit-start", "6.1.0-SNAPSHOT")
16+
.withRepository("https://central.sonatype.com/repository/maven-snapshots")
17+
.withBill("org.junit:junit-bom:{{version}}")
18+
.withRoot("org.junit:junit-start"),
19+
// Snapshot
20+
ModuleLookup.ofJUnit("6.1.0-SNAPSHOT").withRoot("org.junit:junit-start:{{version}}"),
21+
// Releases and Pre-Releases
1022
ModuleLookup.ofJUnit("6.0.1"),
1123
ModuleLookup.ofJUnit("5.14.1"),
1224
ModuleLookup.ofJUnit("6.0.0"),
@@ -57,11 +69,7 @@ public class MaveniverseDemo {
5769
ModuleLookup.ofJUnit("5.9.0-M1"),
5870
ModuleLookup.ofJUnit("5.8.2"),
5971
ModuleLookup.ofJUnit("5.8.1"),
60-
ModuleLookup.ofJUnit("5.8.0"), // not going before 5.8.0, as Suite was introduced here
61-
ModuleLookup.of("junit-start", "experiments~junit-onramp-SNAPSHOT")
62-
.withRepository("https://jitpack.io")
63-
.withBill("com.github.junit-team.junit-framework:junit-bom:{{version}}")
64-
.withRoot("com.github.junit-team.junit-framework:junit-start"));
72+
ModuleLookup.ofJUnit("5.8.0")); // not going before 5.8.0, as Suite was introduced here
6573

6674
void main() throws Exception {
6775
var base = "https://repo.maven.apache.org/maven2/eu/maveniverse/maven/plugins/toolbox/";
@@ -110,7 +118,9 @@ private static String computeProperty(List<String> strings) {
110118
return moduleName + "=" + originUri;
111119
}
112120

113-
private static String computeModuleName(String name) {
121+
private static String computeModuleName(String string) {
122+
var space = string.indexOf(' '); // Cut off trailing suffixes, like " [automatic; ..."
123+
var name = space == -1 ? string : string.substring(0, space);
114124
return ModuleDescriptor.newModule(name).build().name();
115125
}
116126

0 commit comments

Comments
 (0)