blunderbuss:sync

Full name:

net.adamcin:blunderbuss-maven-plugin:0.4.0:sync

Description:

Upload the local repository cache to a specific deployment repository. Unlike the standard maven deploy goals, this goal is tolerant of situations where an attempt is made to re-deploy a release artifact to a repository where it already exists. SNAPSHOT artifacts are ignored

In general, this goal should be executed by itself, either standalone after carefully populating a local maven repository, or by a CI build agent in a maven project directory after running mvn install for all project modules, so that all new dependencies that are resolved from upstream repositories can be redeployed to the primary cloud artifact feed.

This goal makes use of simple index jars deployed to (and resolved from) the target repository to keep track of which artifacts have been uploaded or which have been determined to already be present, so that reattempts can be avoided on subsequent executions. When different CI pipelines are deploying to the same repository, use a different indexArtifactId value for each pipeline and include all the values as elements in altIndex so that they cross reference each other while avoiding duplication of index entries.

Attributes:

  • Executes as an aggregator plugin.
  • Requires that Maven runs in online mode.
  • Is NOT inherited by default in multi-project builds.

Required Parameters

Name Type Since Description
<indexArtifactId> String - Specify the artifactId of the index that is resolved and deployed by this execution.
User property is: indexArtifactId.
<indexGroupId> String - Specify the groupId of the index that is resolved and deployed by this execution. This also serves as the default for altIndex elements that omit the groupId part.
User property is: indexGroupId.

Optional Parameters

Name Type Since Description
<altDeploymentRepository> String - Specifies an alternative repository to which the project artifacts should be deployed (other than those specified in <distributionManagement>).
Format: id::url
id
The id can be used to pick up the correct credentials from the settings.xml
url
The location of the repository
Note: In maven-deploy-plugin version 2.x, the format was id::layout::url where layout could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
User property is: altDeploymentRepository.
<altIndex> String - Comma separated list of groupId:artifactId coordinates for other indexes managed in the same deployment repository that will be used as additional filters after the index specified with indexGroupId and indexArtifactId. Each coordinate will be trimmed to nil so that newlines are tolerated in the configuration element in the pom. You may omit the groupId portion, leaving only a colon prefix, in which case the indexGroupId parameter will be assumed.
User property is: altIndex.
<altReleaseDeploymentRepository> String 2.8 The alternative repository to use when the project has a final version. Note: In maven-deploy-plugin version 2.x, the format was id::layout::url where layout could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
User property is: altReleaseDeploymentRepository.
<altSnapshotDeploymentRepository> String 2.8 The alternative repository to use when the project has a snapshot version. Note: In maven-deploy-plugin version 2.x, the format was id::layout::url where layout could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
User property is: altSnapshotDeploymentRepository.
<ignoreFailures> boolean - By default, the plugin will tolerate any failures to deploy or resolve non-reactor artifacts and simply not update their coordinates in the index, and these sync failures will not prevent the plugin from attempting to upload the new index artifact at the end of the exeuction. However, the maven command will exit with a failure if either the failure count is greater than zero or the index artifact upload fails. Set this parameter to true to ignore sync failures and exit maven with a success as long as the upload of the index artifact is successful.
User property is: ignoreFailures.
<limitArtifactCount> long - This can be used for testing configurations against a throwaway deployment repository to avoid having to wait for all artifacts to be uploaded for every iteration.
User property is: blunderbuss.limitArtifactCount.
<reactorAware> boolean - Set to true to treat failures to deploy artifacts matching the GAV of any maven module navigable from the active project as fatal errors, immediately terminating the execution. This parameter has no effect when executed in a directory without a pom.
Default value is: true.
User property is: reactorAware.
<reactorDeploySnapshots> boolean - Set to true to deploy reactor SNAPSHOT artifacts when reactorMode is also set to true. You must specify a snapshot-enabled deployment repository either in the reactor, using distributionManagement/snapshotRepository or as a parameter, using altDeploymentRepository or altSnapshotDeploymentRepository.
User property is: reactorDeploySnapshots.
<skipDeployIndex> boolean - Set to true to skip upload of the new index.
User property is: skipDeployIndex.
<skipResolveIndex> boolean - Set to true to skip resolution of the latest index, which effectively forces the index to be rebuilt from scratch. This does not prevent the index artifacts specified with altIndex from being resolved.
User property is: skipResolveIndex.
<tempDirectory> File - Specify a directory parent path for temporary files. If not specified, the plugin will use project.build.directory if executed in a maven module directory, or otherwise it will use java.io.tmpdir.
User property is: blunderbuss.tempDirectory.
<terminateAtFailureCount> int - Set to a positive integer to terminate the execution as soon as the same number of artifacts fail to deploy or resolve. Early termination will prevent upload of the index artifact.
Default value is: 0.
User property is: terminateAtFailureCount.

Parameter Details

<altDeploymentRepository>

Specifies an alternative repository to which the project artifacts should be deployed (other than those specified in <distributionManagement>).
Format: id::url
id
The id can be used to pick up the correct credentials from the settings.xml
url
The location of the repository
Note: In maven-deploy-plugin version 2.x, the format was id::layout::url where layout could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
  • Type: java.lang.String
  • Required: No
  • User Property: altDeploymentRepository

<altIndex>

Comma separated list of groupId:artifactId coordinates for other indexes managed in the same deployment repository that will be used as additional filters after the index specified with indexGroupId and indexArtifactId. Each coordinate will be trimmed to nil so that newlines are tolerated in the configuration element in the pom. You may omit the groupId portion, leaving only a colon prefix, in which case the indexGroupId parameter will be assumed.
  • Type: java.lang.String
  • Required: No
  • User Property: altIndex

<altReleaseDeploymentRepository>

The alternative repository to use when the project has a final version. Note: In maven-deploy-plugin version 2.x, the format was id::layout::url where layout could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
  • Type: java.lang.String
  • Since: 2.8
  • Required: No
  • User Property: altReleaseDeploymentRepository

<altSnapshotDeploymentRepository>

The alternative repository to use when the project has a snapshot version. Note: In maven-deploy-plugin version 2.x, the format was id::layout::url where layout could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
  • Type: java.lang.String
  • Since: 2.8
  • Required: No
  • User Property: altSnapshotDeploymentRepository

<ignoreFailures>

By default, the plugin will tolerate any failures to deploy or resolve non-reactor artifacts and simply not update their coordinates in the index, and these sync failures will not prevent the plugin from attempting to upload the new index artifact at the end of the exeuction. However, the maven command will exit with a failure if either the failure count is greater than zero or the index artifact upload fails. Set this parameter to true to ignore sync failures and exit maven with a success as long as the upload of the index artifact is successful.
  • Type: boolean
  • Required: No
  • User Property: ignoreFailures

<indexArtifactId>

Specify the artifactId of the index that is resolved and deployed by this execution.
  • Type: java.lang.String
  • Required: Yes
  • User Property: indexArtifactId

<indexGroupId>

Specify the groupId of the index that is resolved and deployed by this execution. This also serves as the default for altIndex elements that omit the groupId part.
  • Type: java.lang.String
  • Required: Yes
  • User Property: indexGroupId

<limitArtifactCount>

This can be used for testing configurations against a throwaway deployment repository to avoid having to wait for all artifacts to be uploaded for every iteration.
  • Type: long
  • Required: No
  • User Property: blunderbuss.limitArtifactCount

<reactorAware>

Set to true to treat failures to deploy artifacts matching the GAV of any maven module navigable from the active project as fatal errors, immediately terminating the execution. This parameter has no effect when executed in a directory without a pom.
  • Type: boolean
  • Required: No
  • User Property: reactorAware
  • Default: true

<reactorDeploySnapshots>

Set to true to deploy reactor SNAPSHOT artifacts when reactorMode is also set to true. You must specify a snapshot-enabled deployment repository either in the reactor, using distributionManagement/snapshotRepository or as a parameter, using altDeploymentRepository or altSnapshotDeploymentRepository.
  • Type: boolean
  • Required: No
  • User Property: reactorDeploySnapshots

<skipDeployIndex>

Set to true to skip upload of the new index.
  • Type: boolean
  • Required: No
  • User Property: skipDeployIndex

<skipResolveIndex>

Set to true to skip resolution of the latest index, which effectively forces the index to be rebuilt from scratch. This does not prevent the index artifacts specified with altIndex from being resolved.
  • Type: boolean
  • Required: No
  • User Property: skipResolveIndex

<tempDirectory>

Specify a directory parent path for temporary files. If not specified, the plugin will use project.build.directory if executed in a maven module directory, or otherwise it will use java.io.tmpdir.
  • Type: java.io.File
  • Required: No
  • User Property: blunderbuss.tempDirectory

<terminateAtFailureCount>

Set to a positive integer to terminate the execution as soon as the same number of artifacts fail to deploy or resolve. Early termination will prevent upload of the index artifact.
  • Type: int
  • Required: No
  • User Property: terminateAtFailureCount
  • Default: 0