flapdoodle-oss/de.flapdoodle.embed.mongo

Allow distributionBaseUrl to be set using a system property

Closed this issue · 6 comments

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.

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

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"));
}

@mmorrisontx now you can set de.flapdoodle.embed.mongo.baseUrl system property to override this.. (see https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/blob/main/docs/Customizations.md#customize-download-url)

@michaelmosmann will this work also for spring3x?

@antdolg1 it must be a system property, not a spring property ..