maven - 使用 maven 生成 karaf 功能时出现 NoFileAssignedException 异常
问题描述
运行 mvn 安装时,我的 karaf 功能项目出现错误。这是 pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.dmasoft.karaf.example</groupId>
<artifactId>assemblies-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.dmasoft.karaf.example.feature</groupId>
<artifactId>dmasoft-feature</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>${project.groupId}/${project.artifactId}:${project.packaging}:${project.version}</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
当我运行我的 mvn clean install 我得到这个错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install) on project dmasoft-feature: NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]
解决方案
maven-install-plugin:3.0.0-M1 自 2018 年 1 月 10 日发布以来,我在包装设置为 .
解决方案是将 maven-install-plugin 的版本显式设置为以前的版本(2.5.2),这样它就不会自动解析该版本。注意:我也必须为 maven-deploy-plugin 执行此操作。可能还有其他人。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
推荐阅读
- d3.js - D3 sankey 图中更亮的节点颜色
- javascript - 根据嵌套数组中的一些值查找两个数组之间的差异
- windows - 如何在 Visual Studio 2019 集成终端中使用 git 命令
- python - 当我使主窗口全屏时如何使框架扩展?
- python - 如何从 .csv Python 数据框中的列中打印单个字符串单元格?
- javascript - 项目超过限制时引导导航栏折叠菜单
- php - 调用 github api 不会返回任何东西
- embedded - 是否可以对 STM32 设备进行无线编程?
- python - 如何在不丢失数据的情况下通过网络在 python 中发送文件?
- twilio-api - 运营商正在标记其他任何对 Twilio SMS 消息有问题的人吗?