Package org.apache.maven.plugins.deploy
Class DeployMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.deploy.AbstractDeployMojo
-
- org.apache.maven.plugins.deploy.DeployMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="deploy", defaultPhase=DEPLOY, threadSafe=true) public class DeployMojo extends AbstractDeployMojo
Deploys an artifact to remote repository.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
ALT_LEGACY_REPO_SYNTAX_PATTERN
private static java.util.regex.Pattern
ALT_REPO_SYNTAX_PATTERN
private java.lang.String
altDeploymentRepository
Specifies an alternative repository to which the project artifacts should be deployed (other than those specified in <distributionManagement>).private java.lang.String
altReleaseDeploymentRepository
The alternative repository to use when the project has a final version.private java.lang.String
altSnapshotDeploymentRepository
The alternative repository to use when the project has a snapshot version.private boolean
deployAtEnd
Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build.private static java.util.List<org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest>
DEPLOYREQUESTS
private org.apache.maven.project.MavenProject
project
private org.apache.maven.shared.transfer.project.deploy.ProjectDeployer
projectDeployer
Component used to deploy project.private java.util.List<org.apache.maven.project.MavenProject>
reactorProjects
private static java.util.concurrent.atomic.AtomicInteger
READYPROJECTSCOUNTER
When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready to be deployedprivate java.lang.String
skip
Set this to 'true' to bypass artifact deploy Since since 3.0.0-M2 it's not anymore a real boolean as it can have more than 2 values: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 any other values will be considered asfalse
-
Constructor Summary
Constructors Constructor Description DeployMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
deployProject(org.apache.maven.project.ProjectBuildingRequest pbr, org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest pir, org.apache.maven.artifact.repository.ArtifactRepository repo)
void
execute()
(package private) org.apache.maven.artifact.repository.ArtifactRepository
getDeploymentRepository(org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest pdr)
-
Methods inherited from class org.apache.maven.plugins.deploy.AbstractDeployMojo
createDeploymentArtifactRepository, failIfOffline, getRetryFailedDeploymentCount, getSession, warnIfAffectedPackagingAndMaven
-
-
-
-
Field Detail
-
ALT_LEGACY_REPO_SYNTAX_PATTERN
private static final java.util.regex.Pattern ALT_LEGACY_REPO_SYNTAX_PATTERN
-
ALT_REPO_SYNTAX_PATTERN
private static final java.util.regex.Pattern ALT_REPO_SYNTAX_PATTERN
-
READYPROJECTSCOUNTER
private static final java.util.concurrent.atomic.AtomicInteger READYPROJECTSCOUNTER
When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready to be deployed
-
DEPLOYREQUESTS
private static final java.util.List<org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest> DEPLOYREQUESTS
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) private org.apache.maven.project.MavenProject project
-
reactorProjects
@Parameter(defaultValue="${reactorProjects}", required=true, readonly=true) private java.util.List<org.apache.maven.project.MavenProject> reactorProjects
-
deployAtEnd
@Parameter(defaultValue="false", property="deployAtEnd") private boolean deployAtEnd
Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build. If set totrue
and the build fails, none of the reactor projects is deployed. (experimental)- Since:
- 2.8
-
altDeploymentRepository
@Parameter(property="altDeploymentRepository") private java.lang.String 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
id::layout::url
wherelayout
could bedefault
(ie. Maven 2) orlegacy
(ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.
-
altSnapshotDeploymentRepository
@Parameter(property="altSnapshotDeploymentRepository") private java.lang.String altSnapshotDeploymentRepository
The alternative repository to use when the project has a snapshot version. Note: In version 2.x, the format wasid::layout::url
wherelayout
could bedefault
(ie. Maven 2) orlegacy
(ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.- Since:
- 2.8
- See Also:
altDeploymentRepository
-
altReleaseDeploymentRepository
@Parameter(property="altReleaseDeploymentRepository") private java.lang.String altReleaseDeploymentRepository
The alternative repository to use when the project has a final version. Note: In version 2.x, the format wasid::layout::url
wherelayout
could bedefault
(ie. Maven 2) orlegacy
(ie. Maven 1), but since 3.0.0 the layout part has been removed because Maven 3 only supports Maven 2 repository layout.- Since:
- 2.8
- See Also:
altDeploymentRepository
-
skip
@Parameter(property="maven.deploy.skip", defaultValue="false") private java.lang.String skip
Set this to 'true' to bypass artifact deploy Since since 3.0.0-M2 it's not anymore a real boolean as it can have more than 2 values: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- any other values will be considered as
false
- Since:
- 2.4
-
projectDeployer
@Component private org.apache.maven.shared.transfer.project.deploy.ProjectDeployer projectDeployer
Component used to deploy project.
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
deployProject
private void deployProject(org.apache.maven.project.ProjectBuildingRequest pbr, org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest pir, org.apache.maven.artifact.repository.ArtifactRepository repo) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
getDeploymentRepository
org.apache.maven.artifact.repository.ArtifactRepository getDeploymentRepository(org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest pdr) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
-