使用 maven 生成 karaf 功能时出现 NoFileAssignedException 异常
NoFileAssignedException exception when generating karaf feature with maven
我 运行 安装 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 日发布
因为,我在打包设置为 .
的 flexmojos 项目中遇到了同样的错误
解决方法是将 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>
现在您可以将 mule.tools.version 更改为 1.7 1.7 而不是设置 maven 插件版本,如果您正在使用它。
我 运行 安装 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 日发布 因为,我在打包设置为 .
的 flexmojos 项目中遇到了同样的错误解决方法是将 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>
现在您可以将 mule.tools.version 更改为 1.7 1.7 而不是设置 maven 插件版本,如果您正在使用它。