Skip to content

The strongbox-cron-tasks.yaml File

This resource file describes the configuration of the Strongbox cron jobs which are a flexible way to configure recurring tasks for strongbox distribution.

The property controlling this file is strongbox.cron.tasks.yaml. The default location for this resource is etc/conf/strongbox-cron-tasks.yaml.

This file is read by the system at the server startup time and it automatically schedules (and executes, if needed) tasks based on the provided configuration. All cron task configurations located in this file have to be strongbox supported cron task configurations. Currently, there is no way to provide your own implementation of the cron task.

File Structure

For an example, check here

Every cron task configuration is an cronTaskConfigurations array element. Inner properties are:

  • uuid: identifies the individual cron task configuration in the system

  • name: cron task configuration name

  • oneTimeExecution: specifies whether the declared cron task shouldn't be recurring; if true it will only be one time executed and removed and rescheduled from the system

  • immediateExecution: specifies whether the declared cron task should be run immediately

  • properties: specifies the list of properties for the given cron job

  • cronExpression: mandatory property for each cron task configuration (see doc)

  • jobClass: specifies the underlying cron task implementation (mandatory property for each cron task configuration)

  • additional set of mandatory/optional properties individually allowed and described below per each individual cron task configuration

Available Cron Task Configurations

Repository Layout-Independent Cron Task Configuration

Description Implementation Mandatory properties Optional properties
Empty Trash org.carlspring.strongbox.cron.jobs.ClearRepositoryTrashCronJob storageId
repositoryId
Regenerate Checksums org.carlspring.strongbox.cron.jobs.RegenerateChecksumCronJob storageId
repositoryId
basePath
forceRegeneration
Cleanup Expired Artifacts From Proxy Repositories org.carlspring.strongbox.cron.jobs.CleanupExpiredArtifactsFromProxyRepositoriesCronJob lastAccessedTimeInDays minSizeInBytes

Maven-Specific Cron Task Configuration

Description Implementation Mandatory properties Optional properties
Rebuild Maven Metadata org.carlspring.strongbox.cron.jobs.RebuildMavenMetadataCronJob storageId
repositoryId
basePath
Rebuild Maven Indexes org.carlspring.strongbox.cron.jobs.RebuildMavenIndexesCronJob storageId
repositoryId
basePath
Download Remote Indexes org.carlspring.strongbox.cron.jobs.DownloadRemoteMavenIndexCronJob storageId
repositoryId
Remove Timestamped Snapshot Artifacts org.carlspring.strongbox.cron.jobs.RemoveTimestampedMavenSnapshotCronJob storageId
repositoryId
basePath
numberToKeep
keepPeriod

Nuget-Specific Cron Task Configuration

Description Implementation Mandatory properties Optional properties
Download Remote Feed org.carlspring.strongbox.cron.jobs.DownloadRemoteFeedCronJob storageId
repositoryId

Information For Developers

The following classes are related to various aspects of the authorization configuration:

Class Name Description
org.carlspring.strongbox.cron.domain.CronTasksConfigurationDto Represents cron configuration in a deserialized form.
org.carlspring.strongbox.cron.config.CronTasksConfigurationFileManager Class to serialize / deserialize the cron configuration.

The strongbox-cron-tasks.yaml, which is packaged in the distribution, is located under the strongbox-storage-api-resources's src/main/resources/etc/conf directory.


Last update: 2020-12-07