diff --git a/as-iwant-developer/i-have/conf/iwant-from b/as-iwant-developer/i-have/conf/iwant-from index 116f50b3..a41ef455 100644 --- a/as-iwant-developer/i-have/conf/iwant-from +++ b/as-iwant-developer/i-have/conf/iwant-from @@ -1 +1 @@ -iwant-from=https://github.com/wipu/iwant/archive/8a6f2159a1251d51d244b542dada94efec9db4eb.zip +iwant-from=file:///tmp/iwant-for-iwant/all.zip diff --git a/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/IwantModules.java b/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/IwantModules.java index 55e67f4c..001866df 100644 --- a/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/IwantModules.java +++ b/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/IwantModules.java @@ -1,7 +1,9 @@ package org.fluentjava.iwant.wsdef; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -14,12 +16,21 @@ import org.fluentjava.iwant.api.javamodules.ScalaVersion; import org.fluentjava.iwant.api.model.Source; import org.fluentjava.iwant.api.model.Target; +import org.fluentjava.iwant.api.wsdef.WorkspaceContext; +import org.fluentjava.iwant.core.download.Downloaded; import org.fluentjava.iwant.core.download.FromRepository; +import org.fluentjava.iwant.core.download.GnvArtifact; +import org.fluentjava.iwant.core.download.TestedIwantDependencies; import org.fluentjava.iwant.core.javamodules.JavaModules; public class IwantModules extends JavaModules { private static final ScalaVersion SCALA_VER = ScalaVersion.of("2.12.3"); + private final WorkspaceContext ctx; + + public IwantModules(WorkspaceContext ctx) { + this.ctx = ctx; + } @Override protected IwantSrcModuleSpex commonSettings(IwantSrcModuleSpex m) { @@ -29,45 +40,38 @@ protected IwantSrcModuleSpex commonSettings(IwantSrcModuleSpex m) { SortedSet modulesForCoverage() { SortedSet mods = new TreeSet<>(allSrcModules()); - mods.remove(iwantExampleWsdef); - mods.remove(iwantMockWsroot); - mods.remove(iwantTutorialWsdefs); + mods.remove(iwantExampleWsdef()); + mods.remove(iwantMockWsroot()); + mods.remove(iwantTutorialWsdefs()); return mods; } private IwantSrcModuleSpex essentialModule(String subName) { String fullName = "iwant-" + subName; - return module(fullName).locationUnderWsRoot("essential/" + fullName); + return module(fullName).locationUnderWsRoot("essential/" + fullName) + .testDeps(ctx.iwantPlugin().junit5runner().withDependencies()); } private IwantSrcModuleSpex optionalModule(String subName) { String fullName = "iwant-" + subName; - return module(fullName).locationUnderWsRoot("optional/" + fullName); + return module(fullName).locationUnderWsRoot("optional/" + fullName) + .testDeps(ctx.iwantPlugin().junit5runner().withDependencies()); } private IwantSrcModuleSpex privateModule(String subName) { String fullName = "iwant-" + subName; - return module(fullName).locationUnderWsRoot("private/" + fullName); + return module(fullName).locationUnderWsRoot("private/" + fullName) + .testDeps(ctx.iwantPlugin().junit5runner().withDependencies()); } private IwantSrcModuleSpex module(String fullName) { - return srcModule(fullName).javaCompliance(JavaCompliance.JAVA_1_8); + return srcModule(fullName).javaCompliance(JavaCompliance.JAVA_17); } - /** - * TODO reuse with TestedIwantDependencies - * - * @return - */ - private JavaModule ant = binModule("org.apache.ant", "ant", "1.10.7"); + private JavaModule ant = binModule(TestedIwantDependencies.antJar()); - /** - * TODO reuse with TestedIwantDependencies - * - * @return - */ - private JavaModule antLauncher = binModule("org.apache.ant", "ant-launcher", - "1.10.14"); + private JavaModule antLauncher = binModule( + TestedIwantDependencies.antLauncherJar()); private JavaModule asm = JavaBinModule .providing(FromRepository.repo1MavenOrg().group("org.ow2.asm") @@ -104,44 +108,22 @@ private IwantSrcModuleSpex module(String fullName) { .name("jaxen").version("2.0.0").jar()) .end(); - private final JavaBinModule hamcrestCore = binModule("org/hamcrest", - "hamcrest-core", "1.3"); - private final JavaModule junit = binModule("junit", "junit", "4.13.2", - hamcrestCore); - private static final String JUNIT_PLATFORM_VER = "1.10.2"; - private final JavaModule junitPlatformLauncher = binModule( - "org.junit.platform", "junit-platform-launcher", - JUNIT_PLATFORM_VER); - private final JavaModule junitPlatformConsole = binModule( - "org.junit.platform", "junit-platform-console", JUNIT_PLATFORM_VER, - junitPlatformLauncher); - private static final String JUNIT_JUPITER_VER = "5.10.2"; - private final JavaModule junitPlatformCommons = binModule( - "org.junit.platform", "junit-platform-commons", JUNIT_PLATFORM_VER); - private final JavaModule junitPlatformEngine = binModule( - "org.junit.platform", "junit-platform-engine", JUNIT_PLATFORM_VER); - private final JavaModule junitJupiter = binModule("org.junit.jupiter", - "junit-jupiter", JUNIT_JUPITER_VER, junitPlatformCommons, - junitPlatformEngine); - private final JavaModule junitJupiterApi = binModule("org.junit.jupiter", - "junit-jupiter-api", JUNIT_JUPITER_VER); - private final JavaModule junitJupiterEngine = binModule("org.junit.jupiter", - "junit-jupiter-engine", JUNIT_JUPITER_VER); - private final JavaModule junitJupiterParams = binModule("org.junit.jupiter", - "junit-jupiter-params", JUNIT_JUPITER_VER); - private final JavaModule junitVintageEngine = binModule("org.junit.vintage", - "junit-vintage-engine", JUNIT_JUPITER_VER); - private final JavaBinModule opentest4j = binModule("org.opentest4j", - "opentest4j", "1.3.0"); - - private List jupiterCompileDeps() { - return List.of(junit, junitJupiter, junitJupiterApi); - } - - private List jupiterRtDeps() { - return List.of(junitJupiterEngine, junitPlatformCommons, - junitJupiterParams, junitPlatformConsole, junitPlatformEngine, - junitVintageEngine, opentest4j); + private static final JavaModule junit() { + return JavaBinModule.providing(TestedIwantDependencies.junit()).end(); + } + + private static final Set junitJupiterModules() { + // TODO rm redundancy between this and WorkspaceDefinitionContextImpl + Set deps = new LinkedHashSet<>(); + for (GnvArtifact dep : TestedIwantDependencies + .junitJupiterCompileDeps()) { + deps.add(JavaBinModule.providing(dep).end()); + } + for (GnvArtifact dep : TestedIwantDependencies + .junitJupiterRtDeps()) { + deps.add(JavaBinModule.providing(dep).end()); + } + return deps; } private final JavaBinModule ooxmlNiceXmlMessages = binModule( @@ -212,145 +194,202 @@ private static JavaBinModule nettyModule(String name) { private final JavaBinModule xmlresolver = binModule("org.xmlresolver", "xmlresolver", "6.0.8"); - private JavaSrcModule iwantApiModel = essentialModule("api-model") - .mainDeps().testDeps(junit).end(); + private JavaSrcModule iwantEntry() { + return lazy(() -> module("iwant-entry") + .locationUnderWsRoot("essential/iwant-entry").noMainJava() + .mainJava("as-some-developer/with/java").noTestJava().mainDeps() + .end()); + } - private JavaBinModule iwantWsRootMarker = JavaBinModule - .providing(Source.underWsroot("essential/iwant-wsroot-marker")) - .end(); + private JavaSrcModule iwantApiModel() { + return lazy( + () -> essentialModule("api-model").mainDeps().testDeps().end()); + } - private JavaSrcModule iwantIwantWsrootFinder = essentialModule( - "iwant-wsroot-finder").mainDeps(iwantWsRootMarker) - .testDeps(commonsIo, junit).end(); + private JavaBinModule iwantWsRootMarker() { + return lazy(() -> JavaBinModule + .providing(Source.underWsroot("essential/iwant-wsroot-marker")) + .end()); + } - private JavaSrcModule iwantEntry = essentialModule("entry").noMainJava() - .mainJava("as-some-developer/with/java").noTestJava().mainDeps() - .end(); + private JavaSrcModule iwantIwantWsrootFinder() { + return lazy(() -> essentialModule("iwant-wsroot-finder") + .mainDeps(iwantWsRootMarker()).testDeps(commonsIo).end()); + } - private JavaSrcModule iwantTestarea = privateModule("testarea").noTestJava() - .mainDeps(iwantEntry, junit).end(); + private JavaSrcModule iwantTestarea() { + return lazy(() -> privateModule("testarea").noTestJava() + .mainDeps(iwantEntry(), junit()).end()); + } - private JavaSrcModule iwantEntrymocks = privateModule("entrymocks") - .mainDeps(iwantEntry, iwantTestarea).testDeps(junit).end(); + private JavaSrcModule iwantEntrymocks() { + return lazy(() -> privateModule("entrymocks") + .mainDeps(iwantEntry(), iwantTestarea()).testDeps().end()); + } - private JavaSrcModule iwantEntry2 = essentialModule("entry2") - .mainDeps(iwantEntry).testDeps(iwantEntrymocks, - iwantIwantWsrootFinder, iwantTestarea, junit) - .end(); + private JavaSrcModule iwantEntry2() { + return lazy( + () -> essentialModule("entry2") + .mainDeps(iwantEntry()).testDeps(iwantEntrymocks(), + iwantIwantWsrootFinder(), iwantTestarea()) + .end()); + } - private JavaSrcModule iwantCoreservices = essentialModule("coreservices") - .mainDeps(iwantApiModel, iwantEntry, iwantEntry2) - .testDeps(iwantTestarea, junit).end(); - - private JavaSrcModule iwantApimocks = privateModule("apimocks") - .mainDeps(iwantApiModel, iwantCoreservices, iwantEntry, - iwantEntrymocks, iwantTestarea, junit) - .noTestJava().end(); - - private JavaSrcModule iwantApiTarget = essentialModule("api-target") - .mainDeps(iwantApiModel).testDeps(junit).end(); - - private JavaSrcModule iwantApiCore = essentialModule("api-core") - .mainDeps(iwantApiModel, iwantApiTarget, iwantCoreservices, - iwantEntry) - .testDeps(iwantApimocks, junit).end(); - - private JavaSrcModule iwantApiAntrunner = essentialModule("api-antrunner") - .noMainResources().noTestResources().mainDeps(ant, iwantEntry) - .testDeps(junit).end(); - - private JavaSrcModule iwantCoreDownload = essentialModule("core-download") - .mainDeps(iwantApiCore, iwantApiModel, iwantApiTarget, - iwantCoreservices, iwantEntry, iwantEntry2) - .testDeps(iwantApimocks, iwantTestarea, junit).end(); - - private JavaSrcModule iwantApiZip = essentialModule("api-zip") - .testResources("src/test/resources").mainDeps(ant, antLauncher, - iwantApiCore, iwantApiModel, iwantApiTarget) - .testDeps(iwantApimocks, junit).end(); - - private JavaSrcModule iwantApiJavamodules = essentialModule( - "api-javamodules") - .mainDeps(iwantApiAntrunner, iwantApiCore, iwantApiModel, - iwantApiTarget, iwantApiZip, iwantCoreDownload, - iwantCoreservices, iwantEntry) - .testDeps(iwantApimocks, iwantTestarea, guava, guavaTestlib, - junit) - .end(); - - private JavaSrcModule iwantApiWsdef = essentialModule("api-wsdef") - .noTestJava().mainDeps(iwantApiModel, iwantApiJavamodules).end(); - - private JavaSrcModule iwantCoreJavamodules = essentialModule( - "core-javamodules") - .mainDeps(iwantApiJavamodules, iwantApiModel, - iwantApiTarget, iwantApiZip, iwantCoreDownload) - .testDeps(junit).end(); - - private JavaSrcModule iwantApiBash = essentialModule("api-bash") - .mainResources("src/main/resources") - .testResources("src/test/resources") - .mainDeps(iwantApiCore, iwantApiJavamodules, iwantApiModel, - iwantApiTarget, iwantApiWsdef, iwantCoreservices, - iwantEntry) - .testDeps(iwantApimocks, junit).end(); - - private JavaSrcModule iwantPlannerApi = essentialModule("planner-api") - .mainDeps(iwantEntry).testDeps(junit).end(); - - private JavaSrcModule iwantPlannerMocks = essentialModule("planner-mocks") - .noTestJava().mainDeps(iwantPlannerApi, junit).end(); - - private JavaSrcModule iwantPlanner = essentialModule("planner") - .mainDeps(iwantEntry, iwantPlannerApi) - .testDeps(iwantPlannerMocks, junit).end(); - - private JavaSrcModule iwantEclipseSettings = essentialModule( - "eclipse-settings") - .mainDeps(iwantApiCore, iwantApiJavamodules, iwantApiModel, - iwantApiTarget, iwantEntry) - .testDeps(iwantApimocks, junit).end(); - - private JavaSrcModule iwantCoreJavafinder = essentialModule( - "core-javafinder") - .mainDeps(iwantApiJavamodules, iwantApiModel, iwantApiWsdef, - iwantEntry) - .testDeps(junit).end(); - - private JavaSrcModule iwantEntry3 = essentialModule("entry3") - .mainDeps(iwantApiBash, iwantApiCore, iwantApiJavamodules, - iwantApiModel, iwantApiTarget, iwantApiWsdef, - iwantCoreDownload, iwantCoreJavafinder, iwantCoreservices, - iwantEntry, iwantEntry2, iwantIwantWsrootFinder, - iwantPlanner, iwantPlannerApi) - .testDeps(iwantApimocks, iwantEclipseSettings, iwantEntrymocks, - iwantPlannerMocks, iwantTestarea, junit) - .end(); + private JavaSrcModule iwantCoreservices() { + return lazy(() -> essentialModule("coreservices") + .mainDeps(iwantApiModel(), iwantEntry(), iwantEntry2()) + .testDeps(iwantTestarea()).end()); + } - private JavaSrcModule iwantEmbedded = essentialModule("embedded") - .mainDeps(iwantApiModel, iwantApiJavamodules, iwantApiTarget, - iwantApiWsdef, iwantCoreservices, iwantEntry, iwantEntry3) - .testDeps(iwantApimocks, iwantApiCore, iwantTestarea, junit).end(); + private JavaSrcModule iwantApimocks() { + return lazy(() -> privateModule("apimocks") + .mainDeps(iwantApiModel(), iwantCoreservices(), iwantEntry(), + iwantEntrymocks(), iwantTestarea(), junit()) + .noTestJava().end()); + } - private JavaSrcModule iwantCoreAnt = essentialModule("core-ant") - .mainDeps(iwantApiAntrunner, iwantApiCore, iwantApiModel, - iwantApiTarget, iwantCoreservices, iwantEntry) - .testDeps(iwantApimocks, iwantCoreDownload, iwantEmbedded, - iwantTestarea, junit) - .end(); + private JavaSrcModule iwantApiTarget() { + return lazy(() -> essentialModule("api-target") + .mainDeps(iwantApiModel()).testDeps().end()); + } - private JavaSrcModule iwantDocs = privateModule("docs").noMainJava() - .noTestJava().end(); + private JavaSrcModule iwantApiCore() { + return lazy(() -> essentialModule("api-core") + .mainDeps(iwantApiModel(), iwantApiTarget(), + iwantCoreservices(), iwantEntry()) + .testDeps(iwantApimocks()).end()); + } - private JavaSrcModule iwantExampleWsdef = essentialModule("example-wsdef") - .noTestJava() - .mainDeps(iwantApiCore, iwantApiJavamodules, iwantApiModel, - iwantApiTarget, iwantApiWsdef, iwantEntry3, - iwantEclipseSettings) - .end(); + private JavaSrcModule iwantApiAntrunner() { + return lazy(() -> essentialModule("api-antrunner").noMainResources() + .noTestResources().mainDeps(ant, iwantEntry()).testDeps() + .end()); + } + + private JavaSrcModule iwantCoreDownload() { + return lazy(() -> essentialModule("core-download") + .mainDeps(iwantApiCore(), iwantApiModel(), iwantApiTarget(), + iwantCoreservices(), iwantEntry(), iwantEntry2()) + .testDeps(iwantApimocks(), iwantTestarea()).end()); + } + + private JavaSrcModule iwantApiZip() { + return lazy(() -> essentialModule("api-zip") + .testResources("src/test/resources").mainDeps(ant, antLauncher, + iwantApiCore(), iwantApiModel(), iwantApiTarget()) + .testDeps(iwantApimocks()).end()); + } + + private JavaSrcModule iwantApiJavamodules() { + return lazy(() -> essentialModule("api-javamodules") + .mainDeps(iwantApiAntrunner(), iwantApiCore(), iwantApiModel(), + iwantApiTarget(), iwantApiZip(), iwantCoreDownload(), + iwantCoreservices(), iwantEntry()) + .testDeps(iwantApimocks(), iwantTestarea(), guava, guavaTestlib) + .end()); + } + + private JavaSrcModule iwantApiWsdef() { + return lazy(() -> essentialModule("api-wsdef").noTestJava() + .mainDeps(iwantApiModel(), iwantApiJavamodules()).end()); + } + + private JavaSrcModule iwantCoreJavamodules() { + return lazy(() -> essentialModule("core-javamodules") + .mainDeps(iwantApiJavamodules(), iwantApiModel(), + iwantApiTarget(), iwantApiZip(), iwantCoreDownload()) + .testDeps().end()); + } + + private JavaSrcModule iwantApiBash() { + return lazy(() -> essentialModule("api-bash") + .mainResources("src/main/resources") + .testResources("src/test/resources") + .mainDeps(iwantApiCore(), iwantApiJavamodules(), + iwantApiModel(), iwantApiTarget(), iwantApiWsdef(), + iwantCoreservices(), iwantEntry()) + .testDeps(iwantApimocks()).end()); + } + + private JavaSrcModule iwantPlannerApi() { + return lazy(() -> essentialModule("planner-api").mainDeps(iwantEntry()) + .testDeps().end()); + } + + private JavaSrcModule iwantPlannerMocks() { + return lazy(() -> essentialModule("planner-mocks").noTestJava() + .mainDeps(iwantPlannerApi(), junit()).end()); + } + + private JavaSrcModule iwantPlanner() { + return lazy(() -> essentialModule("planner") + .mainDeps(iwantEntry(), iwantPlannerApi()) + .testDeps(iwantPlannerMocks()).end()); + } - final JavaSrcModule iwantMockWsroot = withMockrootMainJavas( - privateModule("mock-wsroot")).noTestJava().mainDeps(junit).end(); + private JavaSrcModule iwantEclipseSettings() { + return lazy(() -> essentialModule("eclipse-settings") + .mainDeps(iwantApiCore(), iwantApiJavamodules(), + iwantApiModel(), iwantApiTarget(), iwantEntry()) + .testDeps(iwantApimocks()).end()); + } + + private JavaSrcModule iwantCoreJavafinder() { + return lazy( + () -> essentialModule("core-javafinder") + .mainDeps(iwantApiJavamodules(), iwantApiModel(), + iwantApiWsdef(), iwantEntry()) + .testDeps().end()); + } + + private JavaSrcModule iwantEntry3() { + return lazy(() -> essentialModule("entry3") + .mainDeps(iwantApiBash(), iwantApiCore(), iwantApiJavamodules(), + iwantApiModel(), iwantApiTarget(), iwantApiWsdef(), + iwantCoreDownload(), iwantCoreJavafinder(), + iwantCoreservices(), iwantEntry(), iwantEntry2(), + iwantIwantWsrootFinder(), iwantPlanner(), + iwantPlannerApi()) + .testDeps(iwantApimocks(), iwantEclipseSettings(), + iwantEntrymocks(), iwantPlannerMocks(), iwantTestarea()) + .end()); + } + + private JavaSrcModule iwantEmbedded() { + return lazy(() -> essentialModule("embedded") + .mainDeps(iwantApiModel(), iwantApiJavamodules(), + iwantApiTarget(), iwantApiWsdef(), iwantCoreservices(), + iwantEntry(), iwantEntry3()) + .testDeps(iwantApimocks(), iwantApiCore(), iwantTestarea()) + .end()); + } + + private JavaSrcModule iwantCoreAnt() { + return lazy(() -> essentialModule("core-ant") + .mainDeps(iwantApiAntrunner(), iwantApiCore(), iwantApiModel(), + iwantApiTarget(), iwantCoreservices(), iwantEntry()) + .testDeps(iwantApimocks(), iwantCoreDownload(), iwantEmbedded(), + iwantTestarea()) + .end()); + } + + private JavaSrcModule iwantDocs() { + return lazy( + () -> privateModule("docs").noMainJava().noTestJava().end()); + } + + private JavaSrcModule iwantExampleWsdef() { + return lazy(() -> essentialModule("example-wsdef").noTestJava() + .mainDeps(iwantApiCore(), iwantApiJavamodules(), + iwantApiModel(), iwantApiTarget(), iwantApiWsdef(), + iwantEntry3(), iwantEclipseSettings()) + .end()); + } + + final JavaSrcModule iwantMockWsroot() { + return lazy(() -> withMockrootMainJavas(privateModule("mock-wsroot")) + .noTestJava().mainDeps().end()); + } private static IwantSrcModuleSpex withMockrootMainJavas( IwantSrcModuleSpex mod) { @@ -369,71 +408,101 @@ private static IwantSrcModuleSpex withMockrootMainJavas( return mod; } - private JavaSrcModule iwantTestresources = privateModule("testresources") - .noTestJava().mainResources("src/main/resources").end(); + private JavaSrcModule iwantTestresources() { + return lazy(() -> privateModule("testresources").noTestJava() + .mainResources("src/main/resources").end()); + } - private JavaSrcModule iwantPluginAnt = optionalModule("plugin-ant") - .mainDeps(ant, antLauncher, iwantApiCore, iwantApiModel) - .testDeps(junit, iwantApimocks, iwantEntry, iwantTestarea, - iwantTestresources) - .end(); + private JavaSrcModule iwantPluginAnt() { + return lazy(() -> optionalModule("plugin-ant") + .mainDeps(ant, antLauncher, iwantApiCore(), iwantApiModel()) + .testDeps(iwantApimocks(), iwantEntry(), iwantTestarea(), + iwantTestresources()) + .end()); + } - private JavaSrcModule iwantPluginFindbugs = optionalModule( - "plugin-findbugs") - .testResources("src/test/resources") - .mainDeps(commonsIo, iwantApiAntrunner, iwantApiCore, - iwantApiJavamodules, iwantApiModel, iwantApiTarget, - iwantCoreAnt, iwantCoreDownload, iwantEntry, - iwantEntry3, iwantPluginAnt) - .testDeps(junit, iwantApimocks, iwantEmbedded, - iwantTestarea) - .end(); - - private JavaSrcModule iwantPluginGithub = optionalModule("plugin-github") - .mainDeps(iwantApiCore, iwantApiModel, iwantApiTarget, iwantApiZip, - iwantCoreDownload, iwantEntry3, iwantPluginAnt) - .testDeps(junit).end(); - - private JavaSrcModule iwantPluginJacoco = optionalModule("plugin-jacoco") - .mainDeps(commonsIo, iwantApiAntrunner, iwantApiCore, iwantApiModel, - iwantApiJavamodules, iwantApiTarget, iwantApiZip, - iwantCoreAnt, iwantCoreDownload, iwantEntry, iwantEntry3, - iwantPluginAnt, junitPlatformConsole) - .mainDeps(jupiterCompileDeps()) - .testDeps(iwantApimocks, iwantEmbedded, iwantTestarea) - .testRuntimeDeps(jupiterRtDeps()).end(); + private JavaSrcModule iwantPluginFindbugs() { + return lazy(() -> optionalModule("plugin-findbugs") + .testResources("src/test/resources") + .mainDeps(commonsIo, iwantApiAntrunner(), iwantApiCore(), + iwantApiJavamodules(), iwantApiModel(), + iwantApiTarget(), iwantCoreAnt(), iwantCoreDownload(), + iwantEntry(), iwantEntry3(), iwantPluginAnt()) + .testDeps(iwantApimocks(), iwantEmbedded(), iwantTestarea()) + .end()); + } + + private JavaSrcModule iwantPluginGithub() { + return lazy( + () -> optionalModule("plugin-github").mainDeps(iwantApiCore(), + iwantApiModel(), iwantApiTarget(), iwantApiZip(), + iwantCoreDownload(), iwantEntry3(), iwantPluginAnt()) + .testDeps().end()); + } + + private JavaSrcModule iwantPluginJacoco() { + return lazy(() -> optionalModule("plugin-jacoco") + .mainDeps(commonsIo, iwantApiAntrunner(), iwantApiCore(), + iwantPluginJunit5Runner(), iwantApiModel(), + iwantApiJavamodules(), iwantApiTarget(), iwantApiZip(), + iwantCoreAnt(), iwantCoreDownload(), iwantEntry(), + iwantEntry3(), iwantPluginAnt()) + .testDeps(iwantApimocks(), iwantEmbedded(), iwantTestarea()) + .end()); + } + + private JavaSrcModule iwantPluginJunit5Runner() { + return lazy(() -> module("iwant-plugin-junit5runner") + .locationUnderWsRoot("optional/iwant-plugin-junit5runner") + .noMainResources().noTestJava().noTestResources() + .mainDeps(iwantEntry()).mainDeps(junitJupiterModules()) + .testDeps().end()); + } // TODO don't depend directly on asm, jaxen, ...: pmd depends on them - private JavaSrcModule iwantPluginPmd = optionalModule("plugin-pmd") - .testResources("src/test/resources").mainDeps(pmdModules) - .mainDeps(ant, asm, commonsIo, commonsLang3, iwantApiCore, - iwantApiModel, iwantApiTarget, iwantEntry, - ooxmlNiceXmlMessages, pcollections, jaxen, saxonHe, - slf4jApi, slf4jJulToSlf4j, slf4jSimple, xmlresolver) - .testDeps(junit, iwantApimocks, iwantTestarea, iwantTestresources) - .end(); + private JavaSrcModule iwantPluginPmd() { + return lazy(() -> optionalModule("plugin-pmd") + .testResources("src/test/resources").mainDeps(pmdModules) + .mainDeps(ant, asm, commonsIo, commonsLang3, iwantApiCore(), + iwantApiModel(), iwantApiTarget(), iwantEntry(), + ooxmlNiceXmlMessages, pcollections, jaxen, saxonHe, + slf4jApi, slf4jJulToSlf4j, slf4jSimple, xmlresolver) + .testDeps(iwantApimocks(), iwantTestarea(), + iwantTestresources()) + .end()); + } - private JavaSrcModule iwantPluginTestng = optionalModule("plugin-testng") - .mainDeps(iwantApiJavamodules, testng).testDeps(iwantEntry, junit) - .end(); + private JavaSrcModule iwantPluginTestng() { + return lazy(() -> optionalModule("plugin-testng") + .mainDeps(iwantApiJavamodules(), testng).testDeps(iwantEntry()) + .end()); + } - private JavaSrcModule iwantPluginWar = optionalModule("plugin-war") - .mainDeps(ant, antLauncher, iwantApiModel) - .testDeps(junit, iwantApimocks, iwantApiZip, iwantEntry, - iwantPluginAnt, iwantTestarea, iwantTestresources) - .end(); + private JavaSrcModule iwantPluginWar() { + return lazy(() -> optionalModule("plugin-war") + .mainDeps(ant, antLauncher, iwantApiModel()) + .testDeps(iwantApimocks(), iwantApiZip(), iwantEntry(), + iwantPluginAnt(), iwantTestarea(), iwantTestresources()) + .end()); + } - private JavaSrcModule iwantTutorialWsdefs = privateModule("tutorial-wsdefs") - .scalaVersion(SCALA_VER).noMainJava().noTestJava().mainJava("src") - .mainDeps(commonsMath, iwantApiBash, iwantApiCore, - iwantApiJavamodules, iwantApiModel, iwantApiTarget, - iwantApiWsdef, iwantApiZip, iwantCoreAnt, iwantCoreDownload, - iwantCoreJavamodules, iwantCoreservices, - iwantCoreJavafinder, iwantEntry3, iwantEclipseSettings, - iwantPluginAnt, iwantPluginFindbugs, iwantPluginGithub, - iwantPluginJacoco, iwantPluginPmd, iwantPluginTestng, - iwantPluginWar, junit, scalaLibrary, testng) - .end(); + private JavaSrcModule iwantTutorialWsdefs() { + return lazy(() -> privateModule("tutorial-wsdefs") + .scalaVersion(SCALA_VER).noMainJava().noTestJava() + .mainJava("src") + .mainDeps(commonsMath, iwantApiBash(), iwantApiCore(), + iwantApiJavamodules(), iwantApiModel(), + iwantApiTarget(), iwantApiWsdef(), iwantApiZip(), + iwantCoreAnt(), iwantCoreDownload(), + iwantCoreJavamodules(), iwantCoreservices(), + iwantCoreJavafinder(), iwantEntry3(), + iwantEclipseSettings(), iwantPluginAnt(), + iwantPluginFindbugs(), iwantPluginGithub(), + iwantPluginJacoco(), iwantPluginPmd(), + iwantPluginTestng(), iwantPluginWar(), junit(), + scalaLibrary, testng) + .end()); + } private final Target extendedIwantEnumsJava = new ExtendedIwantEnums( "extended-iwant-enums"); @@ -442,22 +511,31 @@ private static IwantSrcModuleSpex withMockrootMainJavas( .name(extendedIwantEnumsJava.name() + "-classes") .srcDirs(extendedIwantEnumsJava).end(); - private final JavaModule iwantExtendedEnums = JavaBinModule - .providing(extendedIwantEnumsClasses, extendedIwantEnumsJava).end(); - - private JavaSrcModule iwantEntryTests = privateModule("entry-tests") - .noMainJava().testResources("src/test/resources") - .testDeps(commonsIo, guava, guavaTestlib, iwantApiCore, - iwantApiModel, iwantApiTarget, iwantEntry, iwantEntrymocks, - iwantIwantWsrootFinder, iwantTestarea, junit, nettyBuffer, - nettyCodec, nettyCodecDns, nettyCodecHttp, nettyCodecHttp2, - nettyCommon, nettyHandler, nettyHandlerProxy, nettyResolver, - nettyResolverDns, nettyTransport, vertxCore, vertxWeb) - .end(); + private final JavaModule iwantExtendedEnums() { + return lazy(() -> JavaBinModule + .providing(extendedIwantEnumsClasses, extendedIwantEnumsJava) + .end()); + } - private final JavaSrcModule iwantTests = privateModule("tests").noMainJava() - .testResources("src/test/resources").testDeps(iwantExtendedEnums) - .testDeps(allSrcModules()).testDeps(commonsIo, junit).end(); + private JavaSrcModule iwantEntryTests() { + return lazy(() -> privateModule("entry-tests").noMainJava() + .testResources("src/test/resources") + .testDeps(commonsIo, guava, guavaTestlib, iwantApiCore(), + iwantApiModel(), iwantApiTarget(), iwantEntry(), + iwantEntrymocks(), iwantIwantWsrootFinder(), + iwantTestarea(), nettyBuffer, nettyCodec, nettyCodecDns, + nettyCodecHttp, nettyCodecHttp2, nettyCommon, + nettyHandler, nettyHandlerProxy, nettyResolver, + nettyResolverDns, nettyTransport, vertxCore, vertxWeb) + .end()); + } + + private final JavaSrcModule iwantTests() { + return lazy(() -> privateModule("tests").noMainJava() + .testResources("src/test/resources") + .testDeps(iwantExtendedEnums()).testDeps(allSrcModules()) + .testDeps(commonsIo).end()); + } /** * Just for documenting, to help detect dead stuff @@ -467,9 +545,9 @@ private List modulesNotDependedByOthers() { List m = new ArrayList<>(); // internal: - m.add(iwantDocs); - m.add(iwantEntryTests); - m.add(iwantTests); + m.add(iwantDocs()); + m.add(iwantEntryTests()); + m.add(iwantTests()); return m; } diff --git a/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceFactoryForIwant.java b/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceFactoryForIwant.java index f9ab04a7..d2e4ca5f 100644 --- a/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceFactoryForIwant.java +++ b/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceFactoryForIwant.java @@ -8,7 +8,7 @@ public class WorkspaceFactoryForIwant implements WorkspaceFactory { @Override public Workspace workspace(WorkspaceContext ctx) { - return new WorkspaceForIwant(); + return new WorkspaceForIwant(ctx); } } diff --git a/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceForIwant.java b/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceForIwant.java index 802d6010..fc99eb9d 100644 --- a/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceForIwant.java +++ b/as-iwant-developer/i-have/wsdef/src/main/java/org/fluentjava/iwant/wsdef/WorkspaceForIwant.java @@ -14,6 +14,7 @@ import org.fluentjava.iwant.api.wsdef.SideEffectDefinitionContext; import org.fluentjava.iwant.api.wsdef.TargetDefinitionContext; import org.fluentjava.iwant.api.wsdef.Workspace; +import org.fluentjava.iwant.api.wsdef.WorkspaceContext; import org.fluentjava.iwant.core.download.Downloaded; import org.fluentjava.iwant.core.download.TestedIwantDependencies; import org.fluentjava.iwant.eclipsesettings.EclipseSettings; @@ -29,7 +30,11 @@ public class WorkspaceForIwant implements Workspace { private static final Target copyOfLocalIwantWs = new CopyOfLocalIwantWsForTutorial(); - private final IwantModules modules = new IwantModules(); + private final IwantModules modules; + + public WorkspaceForIwant(WorkspaceContext ctx) { + this.modules = new IwantModules(ctx); + } @Override public List targets(TargetDefinitionContext ctx) { @@ -105,11 +110,13 @@ private static Target logoEpsSh() { sh.string("asy -o \"$DEST\" '"); sh.unixPathTo(logoAsy()); sh.string("'\n"); + // TODO why and since when does asy add another name extension: + sh.string("mv $DEST.eps $DEST\n"); return sh.end(); } private static String imagemagickCommit() { - return "977fe08bf69549506243226a2c8f2488a690b28b"; + return "72fb5349c1489c145a56f49e7f23277fd82af72d"; } private static Target imagemagickZip() { @@ -157,6 +164,8 @@ private static Target faviconIcoSh() { sh.string("cat '").unixPathTo(logoAsy()) .string("' | sed 's/^drawFull();/drawStar();/' > temp.asy\n"); sh.string("asy -o temp.eps temp.asy\n"); + // TODO why and since when does asy add another name extension: + sh.string("mv temp.eps.eps temp.eps\n"); sh.unixPathTo(imagemagick()) .string("/bin/convert temp.eps -resize 32x32 temp.png\n"); sh.string("icotool -c -o \"$DEST\" temp.png\n"); diff --git a/as-iwant-developer/i-have/wsdefdef/src/main/java/org/fluentjava/iwant/wsdefdef/WorkspaceProviderForIwant.java b/as-iwant-developer/i-have/wsdefdef/src/main/java/org/fluentjava/iwant/wsdefdef/WorkspaceProviderForIwant.java index 983928e8..98388281 100644 --- a/as-iwant-developer/i-have/wsdefdef/src/main/java/org/fluentjava/iwant/wsdefdef/WorkspaceProviderForIwant.java +++ b/as-iwant-developer/i-have/wsdefdef/src/main/java/org/fluentjava/iwant/wsdefdef/WorkspaceProviderForIwant.java @@ -18,6 +18,7 @@ public JavaSrcModule workspaceModule(WorkspaceModuleContext ctx) { .mainJava("src/main/java").mainDeps(ctx.iwantApiModules()) .mainDeps(ctx.iwantPlugin().findbugs().withDependencies()) .mainDeps(ctx.iwantPlugin().jacoco().withDependencies()) + .mainDeps(ctx.iwantPlugin().junit5runner().withDependencies()) .mainDeps(commonsIo()).end(); } diff --git a/as-iwant-developer/with/bash/iwant/iwant.sh b/as-iwant-developer/with/bash/iwant/iwant.sh index d4e1881e..4cc9721f 100755 --- a/as-iwant-developer/with/bash/iwant/iwant.sh +++ b/as-iwant-developer/with/bash/iwant/iwant.sh @@ -1,28 +1,58 @@ #!/bin/bash set -eu -COMMIT=8a6f2159a1251d51d244b542dada94efec9db4eb -GITHUBUSER=wipu -URL=https://raw.githubusercontent.com/$GITHUBUSER/iwant/$COMMIT +# Here we use our own newest and shiniest local version of ourselves +# to build HERE=$(dirname "$0") -cd "$HERE/../../.." +cd "$HERE"/../../.. +AS_ID=$(pwd) +cd .. +CLONE=$(pwd) + +TMP=/tmp/iwant-for-iwant +rebuild-tmp() { + echo "Rebuilding $TMP" >&2 + set -x + rm -rf "$TMP" + mkdir -p "$TMP" + cp -a "$CLONE" "$TMP"/all + cd "$TMP"/all + find . -name '*.class' | xargs -r rm + rm -rf as-iwant-developer/.i-cached + rm -rf essential/iwant-core/src/main/bash/new-eclipse-env/cache + cd .. + zip -rq all.zip all + rm -rf all +} +rebuild-tmp fetch() { local RELPATH=$1 - rm -f "$RELPATH" + echo "Fetching $RELPATH" >&2 local PARENT=$(dirname "$RELPATH") - mkdir -p "$PARENT" - cd "$PARENT" - wget "$URL/essential/iwant-entry/as-some-developer/$RELPATH" - cd - + mkdir -p "$AS_ID/$PARENT" + cp -av "$CLONE/essential/iwant-entry/as-some-developer/$RELPATH" "$AS_ID/$PARENT"/ } +set -x fetch with/ant/iw/build.xml fetch with/bash/iwant/help.sh -chmod u+x with/bash/iwant/help.sh +chmod u+x "$AS_ID"/with/bash/iwant/help.sh fetch with/java/org/fluentjava/iwant/entry/Iwant.java -CONF=i-have/conf -mkdir -p "$CONF" -echo "iwant-from=https://github.com/$GITHUBUSER/iwant/archive/$COMMIT.zip" > "$CONF/iwant-from" +# TODO simplify these cache invalidations: + +rm -rf $HOME/.org.fluentjava.iwant/cached/UnmodifiableUrl/file%3A/tmp/iwant-for-iwant/ + +rm -rf $HOME/.org.fluentjava.iwant/cached/UnmodifiableZip/file%3A$HOME/.org.fluentjava.iwant/cached/UnmodifiableUrl/file%25253A/tmp/iwant-for-iwant + +rm -rf $HOME/.org.fluentjava.iwant/cached/UnmodifiableIwantBootstrapperClassesFromIwantWsRoot/file%3A/$HOME/.org.fluentjava.iwant/cached/UnmodifiableZip/file%25253A$HOME/.org.fluentjava.iwant/cached/UnmodifiableUrl/file%252525253A/tmp/iwant-for-iwant/ + +HOME_ENC=$(echo $HOME | sed 's|^/||') + +rm -rf $HOME/.org.fluentjava.iwant/cached/CombinedSrcFromUnmodifiableIwantEssential/%2F$HOME_ENC/.org.fluentjava.iwant/cached/UnmodifiableZip/file%253A$HOME/.org.fluentjava.iwant/cached/UnmodifiableUrl/file%2525253A/tmp/iwant-for-iwant/ + +rm -rf $HOME/.org.fluentjava.iwant/cached/ClassesFromUnmodifiableIwantEssential/%2F$HOME_ENC/.org.fluentjava.iwant/cached/UnmodifiableZip/file%253A$HOME/.org.fluentjava.iwant/cached/UnmodifiableUrl/file%2525253A/tmp/iwant-for-iwant/ + +echo "Done" >&2 diff --git a/essential/iwant-api-wsdef/src/main/java/org/fluentjava/iwant/api/wsdef/IwantPluginWishes.java b/essential/iwant-api-wsdef/src/main/java/org/fluentjava/iwant/api/wsdef/IwantPluginWishes.java index 7dbe87de..ec72a378 100644 --- a/essential/iwant-api-wsdef/src/main/java/org/fluentjava/iwant/api/wsdef/IwantPluginWishes.java +++ b/essential/iwant-api-wsdef/src/main/java/org/fluentjava/iwant/api/wsdef/IwantPluginWishes.java @@ -10,6 +10,8 @@ public interface IwantPluginWishes { IwantPluginWish jacoco(); + IwantPluginWish junit5runner(); + IwantPluginWish pmd(); IwantPluginWish testng(); diff --git a/essential/iwant-core-download/src/main/java/org/fluentjava/iwant/core/download/TestedIwantDependencies.java b/essential/iwant-core-download/src/main/java/org/fluentjava/iwant/core/download/TestedIwantDependencies.java index 84db3ac6..63d9ff7f 100644 --- a/essential/iwant-core-download/src/main/java/org/fluentjava/iwant/core/download/TestedIwantDependencies.java +++ b/essential/iwant-core-download/src/main/java/org/fluentjava/iwant/core/download/TestedIwantDependencies.java @@ -1,32 +1,120 @@ package org.fluentjava.iwant.core.download; +import java.util.List; + import org.fluentjava.iwant.entry2.Iwant2; public class TestedIwantDependencies { + public static final String ANT_VER = Iwant2.ANT_VER; + public static final String JUNIT_PLATFORM_VER = "1.10.2"; + public static final String JUNIT_JUPITER_VER = "5.10.2"; + + private static GnvArtifact gnv(String g, String n, String v) { + return FromRepository.repo1MavenOrg().group(g).name(n).version(v).jar(); + } + + public static List> junitJupiterCompileDeps() { + return List.of(hamcrestCore(), junit(), junitJupiter(), + junitJupiterApi()); + } + + public static List> junitJupiterRtDeps() { + return List.of(junitJupiterEngine(), junitPlatformCommons(), + junitJupiterParams(), junitPlatformConsole(), + junitPlatformLauncher(), junitPlatformEngine(), + junitVintageEngine(), opentest4j()); + } + public static GnvArtifact antJar() { - return FromRepository.repo1MavenOrg().group("org/apache/ant") - .name("ant").version(Iwant2.ANT_VER).jar(); + return gnv("org.apache.ant", "ant", ANT_VER); } public static GnvArtifact antLauncherJar() { - return FromRepository.repo1MavenOrg().group("org/apache/ant") - .name("ant-launcher").version(Iwant2.ANT_VER).jar(); + return gnv("org.apache.ant", "ant-launcher", ANT_VER); } public static GnvArtifact jcommander() { - return FromRepository.repo1MavenOrg().group("com/beust") - .name("jcommander").version("1.82").jar(); + return gnv("com.beust", "jcommander", "1.82"); + } + + public static GnvArtifact commonsIo() { + return gnv("org.apache.commons", "commons-io", "1.3.2"); } public static GnvArtifact junit() { - return FromRepository.repo1MavenOrg().group("junit").name("junit") - .version("4.13.2").jar(); + return gnv("junit", "junit", "4.13.2"); + } + + public static GnvArtifact junitPlatformLauncher() { + return gnv("org.junit.platform", "junit-platform-launcher", + JUNIT_PLATFORM_VER); + } + + public static GnvArtifact junitPlatformConsole() { + return gnv("org.junit.platform", "junit-platform-console", + JUNIT_PLATFORM_VER); } public static GnvArtifact testng() { - return FromRepository.repo1MavenOrg().group("org/testng").name("testng") - .version("6.9.4").jar(); + return gnv("org.testng", "testng", "6.9.4"); + } + + public static GnvArtifact hamcrestCore() { + return gnv("org.hamcrest", "hamcrest-core", "1.3"); + } + + public static GnvArtifact junitPlatformCommons() { + return gnv("org.junit.platform", "junit-platform-commons", + JUNIT_PLATFORM_VER); + } + + public static GnvArtifact junitPlatformEngine() { + return gnv("org.junit.platform", "junit-platform-engine", + JUNIT_PLATFORM_VER); + } + + public static GnvArtifact junitJupiter() { + return gnv("org.junit.jupiter", "junit-jupiter", JUNIT_JUPITER_VER); + } + + public static GnvArtifact junitJupiterApi() { + return gnv("org.junit.jupiter", "junit-jupiter-api", JUNIT_JUPITER_VER); + } + + public static GnvArtifact junitJupiterEngine() { + return gnv("org.junit.jupiter", "junit-jupiter-engine", + JUNIT_JUPITER_VER); + } + + public static GnvArtifact junitJupiterParams() { + return gnv("org.junit.jupiter", "junit-jupiter-params", + JUNIT_JUPITER_VER); + } + + /** + * NOTE: Without this junit5runner won't run old tests written for junit 3 + * or 4. + */ + public static GnvArtifact junitVintageEngine() { + return gnv("org.junit.vintage", "junit-vintage-engine", + JUNIT_JUPITER_VER); + } + + public static GnvArtifact opentest4j() { + return gnv("org.opentest4j", "opentest4j", "1.3.0"); + } + + public static GnvArtifact asm() { + return gnv("asm", "asm", "3.2"); + } + + public static GnvArtifact jaxen() { + return gnv("jaxen", "jaxen", "1.1.4"); + } + + public static GnvArtifact pmd() { + return gnv("pmd", "pmd", "4.3"); } } diff --git a/essential/iwant-core-javamodules/src/main/java/org/fluentjava/iwant/core/javamodules/JavaModules.java b/essential/iwant-core-javamodules/src/main/java/org/fluentjava/iwant/core/javamodules/JavaModules.java index 7b081033..dbf25b74 100644 --- a/essential/iwant-core-javamodules/src/main/java/org/fluentjava/iwant/core/javamodules/JavaModules.java +++ b/essential/iwant-core-javamodules/src/main/java/org/fluentjava/iwant/core/javamodules/JavaModules.java @@ -3,11 +3,14 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import java.util.function.Supplier; import org.fluentjava.iwant.api.javamodules.JavaBinModule; import org.fluentjava.iwant.api.javamodules.JavaCompliance; @@ -21,8 +24,20 @@ public abstract class JavaModules { + private final Map lazyCache = new HashMap<>(); private final SortedSet allSrcModules = new TreeSet<>(); + protected T lazy(Supplier moduleSupplier) { + String caller = new Exception().getStackTrace()[1].getMethodName(); + @SuppressWarnings("unchecked") + T module = (T) lazyCache.get(caller); + if (module == null) { + module = moduleSupplier.get(); + lazyCache.put(caller, module); + } + return module; + } + public SortedSet allSrcModules() { return allSrcModules; } diff --git a/essential/iwant-entry2/src/test/java/org/fluentjava/iwant/entry2/Iwant2Test.java b/essential/iwant-entry2/src/test/java/org/fluentjava/iwant/entry2/Iwant2Test.java index 68622c62..ceeb0221 100644 --- a/essential/iwant-entry2/src/test/java/org/fluentjava/iwant/entry2/Iwant2Test.java +++ b/essential/iwant-entry2/src/test/java/org/fluentjava/iwant/entry2/Iwant2Test.java @@ -47,6 +47,7 @@ public class Iwant2Test extends TestCase { */ @Override public void setUp() { + assertRealIwant3IsNotInClasspath(); origSecman = System.getSecurityManager(); System.setSecurityManager(new ExitCatcher()); originalIn = System.in; @@ -61,6 +62,21 @@ public void setUp() { iwant2 = Iwant2.using(network); } + /** + * Here we test delegation to the "mocked" Iwant3 from iwant-mock-wsroot. + * OTOH it would be cleaner to just configure Iwant2 to call another FQCN + * but, since iwant gives controle over the exact classpath, we'll simply + * guard against accidental breaks with this. + */ + private static void assertRealIwant3IsNotInClasspath() { + try { + Class.forName("org.fluentjava.iwant.entry3.Iwant3"); + fail("Cannot proceed, *real* Iwant3 was found in the classpath"); + } catch (ClassNotFoundException e) { + // expected + } + } + private void useRealAntJars(IwantNetworkMock network) { Iwant2 iw2 = new Iwant2(Iwant.usingRealNetwork().network()); antJar = iw2.antJar(); diff --git a/essential/iwant-entry3/src/main/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImpl.java b/essential/iwant-entry3/src/main/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImpl.java index dc7f4de4..649f2875 100644 --- a/essential/iwant-entry3/src/main/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImpl.java +++ b/essential/iwant-entry3/src/main/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImpl.java @@ -14,7 +14,6 @@ import org.fluentjava.iwant.api.wsdef.IwantPluginWishes; import org.fluentjava.iwant.api.wsdef.WorkspaceModuleContext; import org.fluentjava.iwant.core.download.Downloaded; -import org.fluentjava.iwant.core.download.FromRepository; import org.fluentjava.iwant.core.download.GnvArtifact; import org.fluentjava.iwant.core.download.TestedIwantDependencies; @@ -52,13 +51,8 @@ private Path pluginMainJava(String pluginName) { return ExternalSource.at(src); } - private Set pluginWithDependencies(String pluginName, - Path... dependencies) { - Set depModules = new LinkedHashSet<>(); - for (Path dependency : dependencies) { - depModules.add(JavaBinModule.providing(dependency).end()); - } - return pluginWithDependencies(pluginName, depModules); + private static JavaModule mod(Path artifact) { + return JavaBinModule.providing(artifact).end(); } private Set pluginWithDependencies(String pluginName, @@ -66,9 +60,6 @@ private Set pluginWithDependencies(String pluginName, Path pluginJava = pluginMainJava(pluginName); JavaClassesSpex pluginClasses = JavaClasses.with().name(pluginName) .srcDirs(pluginJava).debug(true); - for (JavaModule iwantApiModule : iwantApiModules) { - pluginClasses.classLocations(iwantApiModule.mainArtifact()); - } for (JavaModule dependency : dependencies) { pluginClasses.classLocations(dependency.mainArtifact()); } @@ -76,7 +67,6 @@ private Set pluginWithDependencies(String pluginName, Set mods = new LinkedHashSet<>(); mods.add( JavaBinModule.providing(pluginClasses.end(), pluginJava).end()); - mods.addAll(iwantApiModules); mods.addAll(dependencies); return mods; } @@ -94,8 +84,11 @@ public Set withDependencies() { // launcher needed in case the user of this plugin also // wants to use AntGenerated that dynamically loads ant // (unless we already have a smarter classloader) - return pluginWithDependencies("iwant-plugin-ant", antJar(), - antLauncherJar()); + Set deps = new LinkedHashSet<>(); + deps.addAll(iwantApiModules); + deps.add(apacheAnt()); + deps.add(apacheAntLauncher()); + return pluginWithDependencies("iwant-plugin-ant", deps); } }; } @@ -106,7 +99,8 @@ public IwantPluginWish findbugs() { @Override public Set withDependencies() { Set deps = new LinkedHashSet<>(); - deps.add(JavaBinModule.providing(commonsIoJar()).end()); + deps.addAll(iwantApiModules); + deps.add(commonsIo()); deps.addAll(ant().withDependencies()); return pluginWithDependencies("iwant-plugin-findbugs", deps); @@ -121,6 +115,7 @@ public IwantPluginWish github() { @Override public Set withDependencies() { Set deps = ant().withDependencies(); + deps.addAll(iwantApiModules); Set modules = pluginWithDependencies( "iwant-plugin-github", deps); return modules; @@ -134,27 +129,60 @@ public IwantPluginWish jacoco() { @Override public Set withDependencies() { Set deps = new LinkedHashSet<>(); + deps.addAll(iwantApiModules); deps.addAll(ant().withDependencies()); - deps.add(JavaBinModule.providing(commonsIoJar()).end()); + deps.add(commonsIo()); return pluginWithDependencies("iwant-plugin-jacoco", deps); } }; } + @Override + public IwantPluginWish junit5runner() { + return new IwantPluginWish() { + @Override + public Set withDependencies() { + // NOTE: it's important *NOT* to add iwantApiModules as deps + // here + // because this junit5runner is used for running tests of + // iwant's own + // modules, and there the existence of real api prevents + // using "mocked" + // versions of them in tests. (Iwant2Test) + // And this module anyway will never need any iwant api: it + // simply calls + // junit with given tests. + Set deps = new LinkedHashSet<>(); + for (GnvArtifact dep : TestedIwantDependencies + .junitJupiterCompileDeps()) { + deps.add(mod(dep)); + } + for (GnvArtifact dep : TestedIwantDependencies + .junitJupiterRtDeps()) { + deps.add(mod(dep)); + } + return pluginWithDependencies("iwant-plugin-junit5runner", + deps); + } + + }; + } + @Override public IwantPluginWish pmd() { return new IwantPluginWish() { @Override public Set withDependencies() { - return pluginWithDependencies("iwant-plugin-pmd", antJar(), - FromRepository.repo1MavenOrg().group("asm") - .name("asm").version("3.2").jar(), - commonsIoJar(), - FromRepository.repo1MavenOrg().group("jaxen") - .name("jaxen").version("1.1.4").jar(), - FromRepository.repo1MavenOrg().group("pmd") - .name("pmd").version("4.3").jar()); + Set deps = new LinkedHashSet<>(); + deps.addAll(iwantApiModules); + deps.add(apacheAnt()); + deps.add(asm()); + deps.add(commonsIo()); + deps.add(jaxen()); + deps.add(pmdPmd()); + + return pluginWithDependencies("iwant-plugin-pmd", deps); } }; @@ -166,8 +194,9 @@ public IwantPluginWish testng() { @Override public Set withDependencies() { Set deps = new LinkedHashSet<>(); - deps.add(JavaBinModule.providing(jcommanderJar()).end()); - deps.add(JavaBinModule.providing(testngJar()).end()); + deps.addAll(iwantApiModules); + deps.add(jcommander()); + deps.add(orgTestng()); return pluginWithDependencies("iwant-plugin-testng", deps); } @@ -179,32 +208,46 @@ public IwantPluginWish war() { return new IwantPluginWish() { @Override public Set withDependencies() { - return pluginWithDependencies("iwant-plugin-war", antJar()); + Set deps = new LinkedHashSet<>(); + deps.addAll(iwantApiModules); + deps.add(apacheAnt()); + return pluginWithDependencies("iwant-plugin-war", deps); } }; } } - private static Path antJar() { - return TestedIwantDependencies.antJar(); + private static JavaModule apacheAnt() { + return mod(TestedIwantDependencies.antJar()); + } + + private static JavaModule apacheAntLauncher() { + return mod(TestedIwantDependencies.antLauncherJar()); + } + + private static JavaModule commonsIo() { + return mod(TestedIwantDependencies.commonsIo()); + } + + private static JavaModule jcommander() { + return mod(TestedIwantDependencies.jcommander()); } - private static Path antLauncherJar() { - return TestedIwantDependencies.antLauncherJar(); + private static JavaModule orgTestng() { + return mod(TestedIwantDependencies.testng()); } - private static GnvArtifact commonsIoJar() { - return FromRepository.repo1MavenOrg().group("org/apache/commons") - .name("commons-io").version("1.3.2").jar(); + private static JavaModule asm() { + return mod(TestedIwantDependencies.asm()); } - private static Path jcommanderJar() { - return TestedIwantDependencies.jcommander(); + private static JavaModule jaxen() { + return mod(TestedIwantDependencies.jaxen()); } - private static Path testngJar() { - return TestedIwantDependencies.testng(); + private static JavaModule pmdPmd() { + return mod(TestedIwantDependencies.pmd()); } } diff --git a/essential/iwant-entry3/src/test/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImplTest.java b/essential/iwant-entry3/src/test/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImplTest.java index 6999e629..d5852924 100644 --- a/essential/iwant-entry3/src/test/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImplTest.java +++ b/essential/iwant-entry3/src/test/java/org/fluentjava/iwant/entry3/WorkspaceDefinitionContextImplTest.java @@ -111,9 +111,11 @@ public void testIwantPluginFindbugsWithDependenciesContainsCorrectModules() { public void testIwantPluginGithubWithDependenciesContainsCorrectModules() { Set mods = ctx.iwantPlugin().github().withDependencies(); - assertEquals("[iwant-plugin-github, iwant-api-1, iwant-api-2," - + " iwant-plugin-ant, ant-1.10.14.jar," - + " ant-launcher-1.10.14.jar]", mods.toString()); + assertEquals( + "[iwant-plugin-github, iwant-plugin-ant," + + " iwant-api-1, iwant-api-2," + + " ant-1.10.14.jar, ant-launcher-1.10.14.jar]", + mods.toString()); } public void testIwantPluginWarWithDependenciesContainsCorrectModules() { @@ -134,6 +136,19 @@ public void testIwantPluginJacocoWithDependenciesContainsCorrectModules() { mods.toString()); } + public void testIwantPluginJunit5runnerWithDependenciesContainsCorrectModules() { + Set mods = ctx.iwantPlugin().junit5runner() + .withDependencies(); + + assertEquals("[iwant-plugin-junit5runner," + + " hamcrest-core-1.3.jar, junit-4.13.2.jar, junit-jupiter-5.10.2.jar," + + " junit-jupiter-api-5.10.2.jar, junit-jupiter-engine-5.10.2.jar," + + " junit-platform-commons-1.10.2.jar, junit-jupiter-params-5.10.2.jar," + + " junit-platform-console-1.10.2.jar, junit-platform-launcher-1.10.2.jar," + + " junit-platform-engine-1.10.2.jar, junit-vintage-engine-5.10.2.jar," + + " opentest4j-1.3.0.jar]", mods.toString()); + } + public void testIwantPluginTestngWithDependenciesContainsCorrectModules() { Set mods = ctx.iwantPlugin().testng().withDependencies(); diff --git a/optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModules.java b/optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModules.java index b906d4b1..e23c2df3 100644 --- a/optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModules.java +++ b/optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModules.java @@ -139,7 +139,7 @@ private static String testRunnerClassNameFor(JavaSrcModule mod) { if (mod.testRunner() != null) { return mod.testRunner().mainClassName(); } - return "org.fluentjava.iwant.plugin.jacoco.Junit5Runner"; + return "org.fluentjava.iwant.plugin.junit5runner.Junit5Runner"; } private void dep(JacocoCoverageSpexPlease coverage, JavaModule mod) { diff --git a/optional/iwant-plugin-jacoco/src/test/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModulesTest.java b/optional/iwant-plugin-jacoco/src/test/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModulesTest.java index 4f43a50d..7f63a282 100644 --- a/optional/iwant-plugin-jacoco/src/test/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModulesTest.java +++ b/optional/iwant-plugin-jacoco/src/test/java/org/fluentjava/iwant/plugin/jacoco/JacocoTargetsOfJavaModulesTest.java @@ -87,7 +87,7 @@ public void testTargetsFromOneMinimalTestOnlyModule() { + "i:jacoco:\n" + " jacoco-0.8.10\n" + "i:antJars:\n" + " " + antJar() + "\n " + antLauncherJar() + "\ni:classLocations:\n" + " mod-test-classes\n" + "p:mainClassName:\n" - + " org.fluentjava.iwant.plugin.jacoco.Junit5Runner\n" + + " org.fluentjava.iwant.plugin.junit5runner.Junit5Runner\n" + "p:mainClassArgs:\n" + " null-collection\n" + "i:mainClassArgsFile:\n" + " mod-test-class-names\n" + "p:jvmargs:\n", coverage.contentDescriptor()); @@ -145,7 +145,7 @@ public String toString() { JacocoCoverage coverageOfOneClass = jacocoTargets .jacocoCoverageOf(testedByOneClass); - assertEquals("org.fluentjava.iwant.plugin.jacoco.Junit5Runner", + assertEquals("org.fluentjava.iwant.plugin.junit5runner.Junit5Runner", coverageOfOneClass.mainClassName()); assertEquals("[custom.Test]", coverageOfOneClass.mainClassArgs().toString()); @@ -153,7 +153,7 @@ public String toString() { JacocoCoverage coverageOfManyClasses = jacocoTargets .jacocoCoverageOf(testedByClassnameFilter); - assertEquals("org.fluentjava.iwant.plugin.jacoco.Junit5Runner", + assertEquals("org.fluentjava.iwant.plugin.junit5runner.Junit5Runner", coverageOfManyClasses.mainClassName()); assertNull(coverageOfManyClasses.mainClassArgs()); ClassNameList testNames = (ClassNameList) coverageOfManyClasses @@ -272,7 +272,7 @@ public void testOwnJunitRunnerIsUsedForCoverageByDefault() { .modules(mod).end(); JacocoCoverage coverage = jacocoTargets.jacocoCoverageOf(mod); - assertEquals("org.fluentjava.iwant.plugin.jacoco.Junit5Runner", + assertEquals("org.fluentjava.iwant.plugin.junit5runner.Junit5Runner", coverage.mainClassName()); } diff --git a/optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/Junit5Runner.java b/optional/iwant-plugin-junit5runner/src/main/java/org/fluentjava/iwant/plugin/junit5runner/Junit5Runner.java similarity index 69% rename from optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/Junit5Runner.java rename to optional/iwant-plugin-junit5runner/src/main/java/org/fluentjava/iwant/plugin/junit5runner/Junit5Runner.java index d0d77bc3..8471d794 100644 --- a/optional/iwant-plugin-jacoco/src/main/java/org/fluentjava/iwant/plugin/jacoco/Junit5Runner.java +++ b/optional/iwant-plugin-junit5runner/src/main/java/org/fluentjava/iwant/plugin/junit5runner/Junit5Runner.java @@ -1,18 +1,14 @@ -package org.fluentjava.iwant.plugin.jacoco; +package org.fluentjava.iwant.plugin.junit5runner; import java.io.PrintWriter; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import org.fluentjava.iwant.entry.Iwant; import org.junit.platform.console.ConsoleLauncher; public class Junit5Runner { public static void main(String[] args) { - Iwant.debugLog(Junit5Runner.class.getCanonicalName(), - Arrays.toString(args)); List runnerArgs = new ArrayList<>(); for (String arg : args) { @@ -20,8 +16,7 @@ public static void main(String[] args) { runnerArgs.add(arg); } if (runnerArgs.isEmpty()) { - Iwant.debugLog(Junit5Runner.class.getCanonicalName(), - "No tests given, exiting."); + System.err.println("No tests given, exiting."); return; } diff --git a/private/iwant-docs/backlog.txt b/private/iwant-docs/backlog.txt index 3aebc999..9099d0f6 100644 --- a/private/iwant-docs/backlog.txt +++ b/private/iwant-docs/backlog.txt @@ -1,3 +1,33 @@ +- junit 5 + + already did before writing this: runner for it + + separate module so it can be used in iwant + + 3 and 4 support to plugin classpath + + cleanup some of the redundant ext dep definitions + - change each mod eclipse conf (manually) to run with junit5, convert at least 1 test to 5 + - simplify iwant for iwant (our iwant.sh): simply use a magic string for tmp, remove by it from cache + - optional old runner when defining javamodules: fluent methods for these + - convert all tests to junit 5 + +- fix local website: broken since who know when + - fix + - make part of continuous practice (maybe after the /tmp usage story) + +- all core and plugin dependencies to exactly one place, usable for users, too + +- conf: *all* possible caches under /tmp, to save SSD and time. Also to force testing against internet rot. + - iwant-test-area especially! + - global setting to only use global cache for downloads, nothing else, TODO how? + - maybe: user can tell something is so slow it needs to be cached permanently + - empty intermediate caches success TODO how to define intermediate? user? + - personal projects (c compilation!), imagemagick, all scripts + - iwant's all caches (unzipped local etc) + - eclipse settings, wish script writing: only write if changes + * also may improve laziness with some (future) features + - what else + +- "text file busy" bug. Still valid and breaking our build. Still neglected. + * So: maybe retry and warning logs? + - migrate to java 11 (EDIT: 17) * eclipse forced this (11) :/ + use it, fix things (upgrade libs, don't use deprecated apis etc) diff --git a/private/iwant-docs/src/main/descript/tutorial/jacoco.sh b/private/iwant-docs/src/main/descript/tutorial/jacoco.sh index eff16b50..86c34acd 100644 --- a/private/iwant-docs/src/main/descript/tutorial/jacoco.sh +++ b/private/iwant-docs/src/main/descript/tutorial/jacoco.sh @@ -18,6 +18,7 @@ cmde "0" "as-iwant-tutorial-developer/with/bash/iwant/side-effect/eclipse-settin p "Then we define the jacoco-report target." +def-edit wsdef jacoco IwanttutorialWorkspaceFactory wsdef-edit jacoco p "We list targets to refresh the wish scripts and then wish for the coverage report." diff --git a/private/iwant-entrymocks/src/main/java/org/fluentjava/iwant/entrymocks/IwantNetworkMock.java b/private/iwant-entrymocks/src/main/java/org/fluentjava/iwant/entrymocks/IwantNetworkMock.java index d1a13b0e..c901b1ab 100644 --- a/private/iwant-entrymocks/src/main/java/org/fluentjava/iwant/entrymocks/IwantNetworkMock.java +++ b/private/iwant-entrymocks/src/main/java/org/fluentjava/iwant/entrymocks/IwantNetworkMock.java @@ -68,4 +68,4 @@ public void usesRealCacheFor(URL url) { Iwant.usingRealNetwork().network().cacheOfContentFrom(src)); } -} \ No newline at end of file +} diff --git a/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspace.java b/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspace.java index a736e79d..2a057eaa 100644 --- a/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspace.java +++ b/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspace.java @@ -3,11 +3,13 @@ import java.io.File; import java.util.Arrays; import java.util.List; +import java.util.Set; import org.fluentjava.iwant.api.core.Concatenated; import org.fluentjava.iwant.api.core.Concatenated.ConcatenatedBuilder; import org.fluentjava.iwant.api.core.HelloTarget; import org.fluentjava.iwant.api.javamodules.JavaBinModule; +import org.fluentjava.iwant.api.javamodules.JavaModule; import org.fluentjava.iwant.api.javamodules.JavaSrcModule; import org.fluentjava.iwant.api.javamodules.JavaSrcModule.IwantSrcModuleSpex; import org.fluentjava.iwant.api.model.Path; @@ -16,6 +18,7 @@ import org.fluentjava.iwant.api.wsdef.SideEffectDefinitionContext; import org.fluentjava.iwant.api.wsdef.TargetDefinitionContext; import org.fluentjava.iwant.api.wsdef.Workspace; +import org.fluentjava.iwant.api.wsdef.WorkspaceContext; import org.fluentjava.iwant.core.download.TestedIwantDependencies; import org.fluentjava.iwant.core.javamodules.JavaModules; import org.fluentjava.iwant.eclipsesettings.EclipseSettings; @@ -24,16 +27,25 @@ public class IwanttutorialWorkspace implements Workspace { - static class ExampleModules extends JavaModules { + private final Set junit5Modules; + private final ExampleModules modules; + + public IwanttutorialWorkspace(WorkspaceContext wsCtx) { + junit5Modules = wsCtx.iwantPlugin().junit5runner().withDependencies(); + modules = new ExampleModules(); + } + + private class ExampleModules extends JavaModules { @Override protected IwantSrcModuleSpex commonSettings(IwantSrcModuleSpex m) { - return super.commonSettings(m).testDeps(junit); + return super.commonSettings(m).testDeps(junit) + .testRuntimeDeps(junit5Modules); } final JavaBinModule hamcrestCore = binModule("org/hamcrest", "hamcrest-core", "1.3"); - final JavaBinModule junit = binModule("junit", "junit", "4.11", + final JavaBinModule junit = binModule("junit", "junit", "4.13.2", hamcrestCore); final JavaSrcModule helloUtil = srcModule("example-helloutil") .noMainResources().end(); @@ -42,8 +54,6 @@ protected IwantSrcModuleSpex commonSettings(IwantSrcModuleSpex m) { } - private final ExampleModules modules = new ExampleModules(); - @Override public List targets(TargetDefinitionContext ctx) { return Arrays.asList(new HelloTarget("hello", "hello from iwant\n"), diff --git a/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspaceFactory.java b/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspaceFactory.java new file mode 100644 index 00000000..4a5b1b2a --- /dev/null +++ b/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionjacoco/IwanttutorialWorkspaceFactory.java @@ -0,0 +1,16 @@ +package com.example.wsdef.editversionjacoco; + +import org.fluentjava.iwant.api.wsdef.Workspace; +import org.fluentjava.iwant.api.wsdef.WorkspaceContext; +import org.fluentjava.iwant.api.wsdef.WorkspaceFactory; + +import com.example.wsdef.editversioncustomtargetselfingr.IwanttutorialWorkspace; + +public class IwanttutorialWorkspaceFactory implements WorkspaceFactory { + + @Override + public Workspace workspace(WorkspaceContext ctx) { + return new IwanttutorialWorkspace(ctx); + } + +} diff --git a/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionv02antgeneratedtarget/IwanttutorialWorkspace.java b/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionv02antgeneratedtarget/IwanttutorialWorkspace.java index b1395c95..7d0931a7 100644 --- a/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionv02antgeneratedtarget/IwanttutorialWorkspace.java +++ b/private/iwant-tutorial-wsdefs/src/com/example/wsdef/editversionv02antgeneratedtarget/IwanttutorialWorkspace.java @@ -44,8 +44,8 @@ private static Target antScript() { } private static Target antGenerated() { - final String antGroup = "org/apache/ant"; - final String antVersion = "1.7.1"; + final String antGroup = "org.apache.ant"; + final String antVersion = "1.10.14"; return AntGenerated.with().name("antGenerated") .antJars( FromRepository.repo1MavenOrg().group(antGroup) diff --git a/private/iwant-tutorial-wsdefs/src/com/example/wsdefdef/editversionv00commonsmathjar/IwantTutorialWorkspaceProvider.java b/private/iwant-tutorial-wsdefs/src/com/example/wsdefdef/editversionv00commonsmathjar/IwantTutorialWorkspaceProvider.java index f2628c6a..ca877f94 100644 --- a/private/iwant-tutorial-wsdefs/src/com/example/wsdefdef/editversionv00commonsmathjar/IwantTutorialWorkspaceProvider.java +++ b/private/iwant-tutorial-wsdefs/src/com/example/wsdefdef/editversionv00commonsmathjar/IwantTutorialWorkspaceProvider.java @@ -27,7 +27,7 @@ public String workspaceFactoryClassname() { private static Target commonsMathJar() { final String v = "1.2"; return Downloaded.withName("commonsMathJar") - .url("http://repo1.maven.org/maven2/commons-math/commons-math/" + .url("https://repo1.maven.org/maven2/commons-math/commons-math/" + v + "/commons-math-" + v + ".jar") .md5("5d3ce091a67e863549de4493e19df069"); }