Skip to content

karaf-maven-plugin feature packaging incompatible with 3.x version of maven-install-plugin and maven-deploy-plugin #2194

@rougeSE

Description

@rougeSE

When trying to generate a feature with the karaf-maven-plugin, the install and deploy phases fail when using 3.X versions of the maven-install-plugin and maven-deploy-plugin with the following error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.1.4:install (default-install) on project test-karaf-feature: 1;31 The packaging plugin for project test-karaf-feature did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]

Reproduce using this example pom

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.example</groupId>
	<artifactId>test-karaf-feature</artifactId>
	<version>1.0.0</version>
	<packaging>feature</packaging>
	<properties>
		<karaf.version>4.4.5</karaf.version>
	</properties>

	<dependencies>
		<!-- Example dependencies to be converted to bundles -->
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-jaxws</artifactId>
			<version>3.3.9</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.karaf.tooling</groupId>
				<artifactId>karaf-maven-plugin</artifactId>
				<version>${karaf.version}</version>
				<extensions>true</extensions>
				<configuration>
					<enableGeneration>true</enableGeneration>
					<includeProjectArtifacts>true</includeProjectArtifacts>
					<ignoreScopeProvided>true</ignoreScopeProvided>								
					<aggregateFeatures>false</aggregateFeatures>
				</configuration>		
			</plugin>
			
		</plugins>
	</build>
</project>

Temporary workaround by enabling allowIncompleteProjects

			<plugin>
				<!-- Version 3.X of the install plugin doesn't seem compatible with the feature packaging of the karaf-maven-plugin resulting in error unless we specify the allowIncompleteProjects=true-->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<configuration>
					<allowIncompleteProjects>true</allowIncompleteProjects>
				</configuration>
			</plugin>
			<plugin>
				<!-- Version 3.X of the deploy plugin doesn't seem compatible with the feature packaging of the karaf-maven-plugin resulting in error unless we specify the allowIncompleteProjects=true-->
				<artifactId>maven-deploy-plugin</artifactId>
				<configuration>
					<allowIncompleteProjects>true</allowIncompleteProjects>
				</configuration>
			</plugin>

But this workaround still generates these warnings

[WARNING] 
[WARNING] The packaging plugin for project test-karaf-feature did not assign
[WARNING] a main file to the project but it has attachments. Change packaging to 'pom'.
[WARNING] 
[WARNING] Incomplete projects like this will fail in future Maven versions!
[WARNING] 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions