flapdoodle-oss / de.flapdoodle.embed.mongo

...will provide a platform neutral way for running mongodb in unittests.
Apache License 2.0
910 stars 160 forks source link

Allow distributionBaseUrl to be set using a system property #540

Open mmorrisontx opened 2 months ago

mmorrisontx commented 2 months ago

In large build systems, it would be useful for distributionBaseUrl to be overridable using a java system property or environment variable, so that the binary download can be redirected to a caching mirror without needing to touch the source of every involved project.

michaelmosmann commented 2 months ago

@mmorrisontx so just change the base url to an mirror, right?

mmorrisontx commented 2 months ago

Yep! Basically just a way to do this from the environment without needing a code change:

@Override
public Transition<DistributionBaseUrl> distributionBaseUrl() {
    return Start.to(DistributionBaseUrl.class)
    .initializedWith(DistributionBaseUrl.of("http://my.custom.download.domain"));
}
michaelmosmann commented 2 months ago

@mmorrisontx will do :)