← 返回命令列表

Linux command

mvn-deploy 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Deploy to repository

mvn deploy

Deploy specific file

mvn deploy:deploy-file -Dfile=[file.jar] -DgroupId=[com.example] -DartifactId=[my-lib] -Dversion=[1.0] -Durl=[repo-url] -DrepositoryId=[repo-id]

Deploy with specific profile

mvn deploy -P [profile-name]

Skip tests and deploy

mvn deploy -DskipTests

Deploy to an alternate repository

mvn deploy -DaltDeploymentRepository=[id::url]

Deploy single module

mvn deploy -pl [module-name]

说明

mvn deploy uploads artifacts to remote repository. It's the final Maven lifecycle phase. The goal publishes built artifacts. Requires repository configuration in settings.xml.

参数

-Dfile _JAR_
File to deploy.
-DrepositoryId _ID_
Repository identifier.
-Durl _URL_
Repository URL.
-DgroupId _GROUP_
Group ID for deploy-file goal.
-DartifactId _ARTIFACT_
Artifact ID for deploy-file goal.
-Dversion _VERSION_
Version for deploy-file goal.
-DaltDeploymentRepository _id::url_
Alternative repository for deployment (format: id::url).
-DskipTests
Skip running tests during the build.
-P _PROFILE_
Activate profile.
-pl _MODULE_
Build specific module.

FAQ

What is the mvn-deploy command used for?

mvn deploy uploads artifacts to remote repository. It's the final Maven lifecycle phase. The goal publishes built artifacts. Requires repository configuration in settings.xml.

How do I run a basic mvn-deploy example?

Run `mvn deploy` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -Dfile _JAR_ do in mvn-deploy?

File to deploy.