为什么<包装>是这样的?包含元素包装>
依赖项是 -
<dependency>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>pluto-container-api</artifactId>
<version>2.0.2</version>
<packaging>bundle</packaging>
</dependency>
不应该是 -
<dependency>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>pluto-container-api</artifactId>
<version>2.0.2</version>
</dependency>
包括该标签似乎导致错误,附加 -
When I navigate to - http://search.maven.org/#artifactdetails%7Corg.apache.portals.pluto%7Cpluto-container-api%7C2.0.2%7Cbundle
the dependency is -
<dependency>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>pluto-container-api</artifactId>
<version>2.0.2</version>
<packaging>bundle</packaging>
</dependency>
Should it not be -
<dependency>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>pluto-container-api</artifactId>
<version>2.0.2</version>
</dependency>
As including the tag seems to cause an error, attached -
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该工件是使用 maven-bundle-plugin 使工件能够在 OSGi 环境中使用(可以在此包的父 pom 中看到)。该插件引入了“
bundle
”打包类型。由于工件仍然是一个“jar”,您可以跳过在依赖项部分中指定
(您可以在存储库 Web 界面中显示的
部分)
中没有
元素,是 maven 坐标)。The artifact was build using the maven-bundle-plugin to enable the artifact to be used in OSGi environments (can be seen in the parent pom of this bundle). This plugin introduces the '
bundle
' packaging type.As the artifact is still a 'jar' you can skip specifying the
<type>
in your dependency section (The presented<dependency>
section of the repository web interface you mentioned is wrong. There is no<packaging>
element inside<dependency>
.<packaging>
is one of the maven coordinates).您引用的 XML 旨在复制并粘贴到 pom.xml 中,这似乎是一个合理的假设。
你说得对。删除
是正确的做法。无需指定类型,因为捆绑工件无论如何都有一个“jar”扩展名。即使包装不是“jar”(例如,它是“war”),正确使用的元素应该是.
而不是It seems like a fair assumption that the XML you quote is intended to be copied and pasted into a pom.xml.
You're right. Removing
<packaging>
is the correct thing to do.There's no need to specify the type, because the bundles artifacts have a 'jar' extension anyway. Even if the packaging was not 'jar' ‒say, for example, it was 'war'‒ the correct element to use would be
<type>
and not<packaging>
.