Configure the POM cache
Moderne Platform services do not talk to your Maven repositories directly. When a service needs a file from a repository that is only reachable inside your network, the request is tunneled through the Moderne Connector, which adds the credentials you configured and makes the call on the service's behalf. Two things drive most of that traffic:
- Recipe loading. Before a recipe can be installed, the Platform walks the recipe artifact's POM dependency graph against your recipe marketplace repositories to assemble its classpath.
- Recipe execution. Recipes that upgrade dependencies read
maven-metadata.xmlto determine which versions your repositories actually serve, so a run over many repositories requests the same metadata many times.
Both paths fetch the same small set of files repeatedly, so the Connector can cache them and serve repeat lookups locally instead of calling your artifact repository again. Only .pom files and maven-metadata.xml are cached — JARs and other artifacts always stream straight through.
Caching is disabled by default. Set the cache type to IN_MEMORY to cache within a single Connector instance, or to REDIS to share one cache across multiple Connector replicas. If the Connector cannot initialize the Redis connection, it logs the failure and runs without a cache.
- OCI Container
- Executable JAR
Environment variables:
| Variable Name | Required | Default | Description |
|---|---|---|---|
MODERNE_CONNECTOR_RECIPE_POMCACHE_TYPE | false | Used to specify what type of cache the POM should use. Acceptable values: IN_MEMORY or REDIS. If unset, no caching is performed. | |
MODERNE_CONNECTOR_RECIPE_POMCACHE_POMTTL | false | 60m | How long cached .pom files should live in the POM cache. Specified as a duration (e.g., 60m, 2h). |
MODERNE_CONNECTOR_RECIPE_POMCACHE_METADATATTL | false | 10m | How long cached maven-metadata.xml files should live in the POM cache. This defaults lower than pomTtl because metadata changes as new versions are published. |
MODERNE_CONNECTOR_RECIPE_POMCACHE_ENTRYTTLMINUTES | false | Deprecated – use MODERNE_CONNECTOR_RECIPE_POMCACHE_POMTTL instead. If set, this value in minutes is used as the .pom TTL. | |
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_HOST | true (If the POM cache type is REDIS) | The URL of the Redis instance. | |
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_PORT | true (If the POM cache type is REDIS) | 6379 | The port number of the Redis instance. |
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_USERNAME | false | The username needed to authenticate to the Redis instance. | |
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_PASSWORD | false | The password needed to authenticate with the Redis instance. | |
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_SSL | false | false | If set to true, then SSL will be enabled for the connection to the Redis instance. |
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_DATABASE | false | 0 | The Redis DB index. |
Example:
docker run \
# ... Existing variables
-e MODERNE_CONNECTOR_RECIPE_POMCACHE_TYPE=REDIS \
-e MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_HOST=localhost \
# ... Additional variables
Arguments:
| Argument Name | Required | Default | Description |
|---|---|---|---|
--moderne.connector.recipe.pomCache.type | false | Used to specify what type of cache the POM should use. Acceptable values: IN_MEMORY or REDIS. If unset, no caching is performed. | |
--moderne.connector.recipe.pomCache.pomTtl | false | 60m | How long cached .pom files should live in the POM cache. Specified as a duration (e.g., 60m, 2h). |
--moderne.connector.recipe.pomCache.metadataTtl | false | 10m | How long cached maven-metadata.xml files should live in the POM cache. This defaults lower than pomTtl because metadata changes as new versions are published. |
--moderne.connector.recipe.pomCache.entryTtlMinutes | false | Deprecated – use --moderne.connector.recipe.pomCache.pomTtl instead. If set, this value in minutes is used as the .pom TTL. | |
--moderne.connector.recipe.pomCache.redis.host | true (If the POM cache type is REDIS) | The URL of the Redis instance. | |
--moderne.connector.recipe.pomCache.redis.port | true (If the POM cache type is REDIS) | 6379 | The port number of the Redis instance. |
--moderne.connector.recipe.pomCache.redis.username | false | The username needed to authenticate to the Redis instance. | |
--moderne.connector.recipe.pomCache.redis.password | false | The password needed to authenticate with the Redis instance. | |
--moderne.connector.recipe.pomCache.redis.ssl | false | false | If set to true, then SSL will be enabled for the connection to the Redis instance. |
--moderne.connector.recipe.pomCache.redis.database | false | 0 | The Redis DB index. |
Example:
java -jar connector-{version}.jar \
# ... Existing arguments
--moderne.connector.recipe.pomCache.type=REDIS \
--moderne.connector.recipe.pomCache.redis.host=localhost \
# ... Additional arguments