我在我的项目中运行mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.1:copy-dependencies
,看到了以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:copy-dependencies (default-cli) on project beam-sdks-java-core: Some problems were encountered while processing the POMs:
[ERROR] [ERROR] Unknown packaging: bundle @ line 6, column 16: 1 problem was encountered while building the effective model for org.xerial.snappy:snappy-java:1.1.4
[ERROR] [ERROR] Unknown packaging: bundle @ line 6, column 16
查看Snappy的pom文件,它如下所示:
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<packaging>bundle</packaging>
<description>snappy-java: A fast compression/decompression library</description>
<version>1.1.4</version>
<name>snappy-java</name>
....
具体来说,<packaging>bundle</packaging>
这一行似乎是问题所在。
我尝试将 maven-bundle-plugin
添加到自己 POM 文件的 <build>
标记中,但这并不能解决问题(为什么要这样做呢?我认为依赖项的配置不应该影响我的POM文件)。
我该如何为我的依赖项启用 maven-bundle-plugin
?我需要将其添加到涉及 apache.maven.plugins:maven-dependency-plugin:3.1.1:copy-dependencies
的POM的特定子部分吗?
另外,我使用的 Maven 版本是 3.5.0。