maven - maven 部署文件的使用

标签 maven

阅读文档。的deploy:deploy-file ( https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html ),似乎唯一需要的参数是
所需参数 <file>, <repositoryId> and <url> ,
尽管如此,当我运行时:

mvn deploy:deploy-file -Durl={url} -DrepositoryId={repoId} -Dfile=D:\Users\nunito\IdeaProjects\calzada\target\calzada.zip
我收到此错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project oib-kw-guards-web: The artifact i
nformation is incomplete or not valid:
[ERROR]   [0]  'groupId' is missing.
[ERROR]   [1]  'artifactId' is missing.
[ERROR]   [2]  'version' is missing.

最佳答案

我通常使用 deploy:deploy-file在命令行中,当我有一个没有 pom.xml 的第 3 方 Artifact 时:

cmd /v /c "set a=an-artifact-name&& set g=com.company.xxx&& \
mvn deploy:deploy-file -Dfile=C:\path\to\!a!.jar -Dpackaging=jar -DgroupId=!g! -DartifactId=!a! \
-Dversion=1.0-DEV-SNAPSHOT -DrepositoryId=nexus \
-Durl=http://company.com/nexus/content/repositories/company-snapshots/"
您需要做的就是修改ag在命令的开头。
如果您有特定版本,则可以添加版本 v,并将其放入 Nexus 的发布部分:
cmd /v /c "set a=an-artifact-name&& set g=com.company.xxx&& && set v=1.2.3&& \
mvn deploy:deploy-file -Dfile=C:\path\to\!a!.jar -Dpackaging=jar -DgroupId=!g! -DartifactId=!a! \
-Dversion=!v! -DrepositoryId=nexus \
-Durl=http://company.com/nexus/content/repositories/company-releases/"

关于maven - maven 部署文件的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63504381/

相关文章:

java - 将 Quarkus 应用于非 Maven、非 Gradle Java 项目

Java:如何从不同的模块读取文件?

java - 更新 org.springframework.boot 版本到 1.3.2

maven - 无法运行ElasticSearch测试

java - 如何从命令行激活 Maven 配置文件(构建子系统)

Spring Boot 自动配置及其依赖项

java - cxf-xjc 插件 "Must specify xsdOptions"错误

java - 从配置文件注入(inject)属性从 Eclipse 在服务器上运行 Maven webapp

java - Springboot Whitelabel 错误页面,状态为 404 : unable to resolve path of JSP

java - Maven 构建具有依赖项的程序集