deploy:deploy-file
Full name:
org.apache.maven.plugins:maven-deploy-plugin:4.0.0-beta-3:deploy-file
Description:
Installs the artifact in the remote repository.
Attributes:
- Requires a Maven project to be executed.
- The goal is not marked as thread-safe and thus does not support parallel builds.
Required Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<file> |
Path |
- |
File to be deployed. |
<repositoryId> |
String |
- |
Server Id to map on the <id> under <server> section of settings.xml In most cases, this parameter will be required for authentication.
Security note: the credentials looked up in |
<url> |
String |
- |
URL where the artifact will be deployed.
ie ( file:///C:/m2-repo or scp://host.com/path/to/repo ) |
Optional Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<artifactId> |
String |
- |
ArtifactId of the artifact to be deployed. Retrieved from POM file if specified. |
<classifier> |
String |
- |
Add classifier to the artifact |
<classifiers> |
String |
- |
A comma separated list of classifiers for each of the extra side artifacts to deploy. If there is a mis-match in the number of entries in files or types, then an error will be raised. |
<containedIn> |
Path |
4.0.0 |
Optional containment directory for all artifact-content paths (file, files, sources, javadoc, pomFile): when set, each of those paths must resolve inside this directory (symlinks are resolved before the comparison) or the build fails.
Intended for CI/automation that fills deploy-file parameters from pipeline variables: without containment, any file readable by the build (for example |
<description> |
String |
- |
Description passed to a generated POM file (in case of generatePom=true) |
<files> |
String |
- |
A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in the number of entries in types or classifiers, then an error will be raised. |
<generatePom> |
boolean |
- |
Upload a POM for this artifact. Will generate a default POM if none is supplied with the pomFile argument. |
<groupId> |
String |
- |
GroupId of the artifact to be deployed. Retrieved from POM file if specified. |
<javadoc> |
Path |
2.6 |
The bundled API docs for the artifact. |
<packaging> |
String |
- |
Type of the artifact to be deployed. Retrieved from the <packaging> element of the POM file if a POM file specified. Defaults to the file extension if it is not specified via command line or POM.
Maven uses two terms to refer to this datum: the <packaging> element for the entire POM, and the <type> element in a dependency specification. |
<pomFile> |
Path |
- |
Location of an existing POM file to be deployed alongside the main artifact, given by the ${file} parameter. |
<retryFailedDeploymentCount> |
int |
2.7 |
Parameter used to control how many times a failed deployment will be retried before giving up and failing. If a value outside the range 1-10 is specified it will be pulled to the nearest value within the range 1-10. |
<skip> |
String |
3.1.0 |
Set this to 'true' to bypass artifact deploy It's not a real boolean as it can have more than 2 values:
releases/snapshots variants are evaluated after the artifact coordinates are known, so a version supplied only via pomFile (or the jar's embedded POM) is classified correctly. |
<sources> |
Path |
2.6 |
The bundled sources for the artifact. |
<types> |
String |
- |
A comma separated list of types for each of the extra side artifacts to deploy. If there is a mis-match in the number of entries in files or classifiers, then an error will be raised. |
<version> |
String |
- |
Version of the artifact to be deployed. Retrieved from POM file if specified. |
Parameter Details
<artifactId>
- Type:
java.lang.String - Required:
No
<classifier>
- Type:
java.lang.String - Required:
No
<classifiers>
files or types, then an error will be raised.- Type:
java.lang.String - Required:
No
<containedIn>
file, files, sources, javadoc, pomFile): when set, each of those paths must resolve inside this directory (symlinks are resolved before the comparison) or the build fails.
Intended for CI/automation that fills deploy-file parameters from pipeline variables: without containment, any file readable by the build (for example ~/.m2/settings.xml passed as a side artifact) can be published to the deployment URL in one invocation. Disabled (no containment) by default; point it at the project or workspace directory in automated pipelines.
- Type:
java.nio.file.Path - Since:
4.0.0 - Required:
No
<description>
- Type:
java.lang.String - Required:
No
<file>
- Type:
java.nio.file.Path - Required:
Yes
<files>
types or classifiers, then an error will be raised.- Type:
java.lang.String - Required:
No
<generatePom>
- Type:
boolean - Required:
No
<groupId>
- Type:
java.lang.String - Required:
No
<javadoc>
- Type:
java.nio.file.Path - Since:
2.6 - Required:
No
<packaging>
Maven uses two terms to refer to this datum: the <packaging> element for the entire POM, and the <type> element in a dependency specification.
- Type:
java.lang.String - Required:
No
<pomFile>
- Type:
java.nio.file.Path - Required:
No
<repositoryId>
Security note: the credentials looked up in settings.xml are selected purely by this id, so a mismatched id/url pair can point credentials kept for one server at a different URL. When this id matches a settings.xml server entry and the URL differs from every URL this build associates with the id, the deployment is refused unless -Dmaven.deploy.allowCredentialReuse=true is given on the command line. When no URL at all is on record for such an id, the deployment proceeds with a warning naming the URL the credentials will be sent to: deploy-file's parameters are command-line-supplied by nature, so the operator typing the pair is treated as the authorization that a POM cannot forge. Also note the default value remote-repository: if a server entry with that generic id exists in settings.xml, its credentials are used whenever this parameter is omitted.
- Type:
java.lang.String - Required:
Yes
<retryFailedDeploymentCount>
- Type:
int - Since:
2.7 - Required:
No
<skip>
true: will skip as usualreleases: will skip if current version of the project is a releasesnapshots: will skip if current version of the project is a snapshot- values are matched case-insensitively; any other value fails the build (fail-closed: a typo in a publish-suppression control must not silently publish)
releases/snapshots variants are evaluated after the artifact coordinates are known, so a version supplied only via pomFile (or the jar's embedded POM) is classified correctly.- Type:
java.lang.String - Since:
3.1.0 - Required:
No
<sources>
- Type:
java.nio.file.Path - Since:
2.6 - Required:
No
<types>
files or classifiers, then an error will be raised.- Type:
java.lang.String - Required:
No
<url>
ie ( file:///C:/m2-repo or scp://host.com/path/to/repo )
- Type:
java.lang.String - Required:
Yes
<version>
- Type:
java.lang.String - Required:
No
