1

我想将 bahir jar 推送到我的本地 m2 存储库。我正在使用 maven-3.5.0 下载的 tar.gz 和 jdk8,两者都设置为环境变量并且工作正常。

我使用maven从git的可用下载中为spark构建了apache bahir,这是BUILD SUCCESS,它创建了一个目标文件夹,其中包含名为bahir-parent_2.11-2.3.0-SNAPSHOT-tests.jar的jar

现在当我执行时:

$mvn install:install-file -Dfile=/home/awisha/trial/bahir-master/target/bahir-parent_2.11-2.3.0-SNAPSHOT-tests.jar -DgroupId=org.apache.bahir -DartifactId=spark-streaming-mqtt_2.11 -Dversion=2.2.0

它应该将 jar 推送到我本地的 .m2/repository。但相反,它给了我以下错误:

[ERROR]   Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The artifact information is incomplete or not valid:
[ERROR]   [0]  'packaging' is missing.

但是当我使用“apt install maven”:maven-3.3.9 时,我得到了 BUILD SUCCESS 我无法弄清楚为什么在使用 maven-3.5.0 时它会给我错误。

4

1 回答 1

1

You need to simply add "-Dpackaging=jar" to your mvn install:install-file cmd:

$mvn install:install-file -Dpackage=jar -Dfile=/home/awisha/trial/bahir-master/target/bahir-parent_2.11-2.3.0-SNAPSHOT-tests.jar -DgroupId=org.apache.bahir -DartifactId=spark-streaming-mqtt_2.11 -Dversion=2.2.0

于 2019-10-04T10:43:15.713 回答