如何在 Maven 2 中手动安装工件? [英] How to manually install an artifact in Maven 2?

查看:13
本文介绍了如何在 Maven 2 中手动安装工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 Maven 2 手动安装工件时遇到了一些错误.我想使用命令从本地目录安装一个 jar

I've encountered some errors when I tried to install an artifact manually with Maven 2. I wanted to install a jar from a local directory with the command

mvn install:install-file -Dfile=jta-1.0.1B.jar

但是 Maven 给出了一个构建错误,内容如下:

But Maven gave a build error which reads like:

Invalid task '.01B.jar': you must
specify a valid lifecycle phase, or a
goal in the format plugin:goal or
pluginGroupId:pluginArtifactId:pluginVersion:goal

我的命令有问题吗?

推荐答案

您需要指明您的工件的 groupId、artifactId 和版本:

You need to indicate the groupId, the artifactId and the version for your artifact:

mvn install:install-file 
  -DgroupId=javax.transaction 
  -DartifactId=jta 
  -Dpackaging=jar 
  -Dversion=1.0.1B 
  -Dfile=jta-1.0.1B.jar 
  -DgeneratePom=true

这篇关于如何在 Maven 2 中手动安装工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆