You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Jens Offenbach (JIRA)" <ji...@apache.org> on 2015/03/18 08:18:39 UTC

[jira] [Commented] (FELIX-4830) Missing version of imported packages

    [ https://issues.apache.org/jira/browse/FELIX-4830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14366761#comment-14366761 ] 

Jens Offenbach commented on FELIX-4830:
---------------------------------------

I have also tested the current maven-bundle-plugin in version 2.5.4-SNAPSHOT. The same problem exists here. Maybe the issue is not directly related to maven-bundle-plugin, but is caused by the bnd library. maven-bundle-plugin 2.4.0 uses bnd in version 2.1. maven-bundle-plugin 2.5.3 and 2.5.4-SNAPSHOT use bnd in version 2.3.0 and version 2.4.1, respectively. If I were more familar with bnd, I could test bnd standalone.

Maybe someone can add the bnd files to my attached sample, in order to check if the problem is actually caused by bnd.

> Missing version of imported packages
> ------------------------------------
>
>                 Key: FELIX-4830
>                 URL: https://issues.apache.org/jira/browse/FELIX-4830
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.5.2
>            Reporter: Jens Offenbach
>         Attachments: FELIX-4830.zip
>
>
> In some cases the manifest file created by maven-bundle-plugin 2.5.2 contains packages without any version declaration. I was able to reproduce the issue. It appears when you import a package into bundles which package namespace contains the imported package name.
> Example:
> We have 3 bundles, one bundle exports the package "org.test". Another bundle places its classes in the package "org.test.impl". The last bundle uses the package "org.testx.impl".
> *Bundle-Manifest: org.test*
> {code}
> Manifest-Version: 1.0
> Bnd-LastModified: 1426619825063
> Build-Jdk: 1.8.0_31
> Bundle-ManifestVersion: 2
> Bundle-Name: org.test
> Bundle-RequiredExecutionEnvironment: JavaSE-1.7
> Bundle-SymbolicName: org.test
> Bundle-Version: 1.0.0.SNAPSHOT
> Created-By: Apache Maven Bundle Plugin
> Export-Package: org.test;version="1.0.0.SNAPSHOT"
> Private-Package: org.test
> Tool: Bnd-2.3.0.201405100607
> {code}
> *Bundle-Manifest: org.test.impl*
> {code}
> Manifest-Version: 1.0
> Bnd-LastModified: 1426619826264
> Build-Jdk: 1.8.0_31
> Bundle-ManifestVersion: 2
> Bundle-Name: org.test.impl
> Bundle-RequiredExecutionEnvironment: JavaSE-1.7
> Bundle-SymbolicName: org.test.impl
> Bundle-Version: 1.0.0.SNAPSHOT
> Created-By: Apache Maven Bundle Plugin
> Import-Package: org.test
> Private-Package: org.test.impl
> Tool: Bnd-2.3.0.201405100607
> {code}
> *Bundle-Manifest: org.testx.impl*
> {code}
> Manifest-Version: 1.0
> Bnd-LastModified: 1426619826857
> Build-Jdk: 1.8.0_31
> Bundle-ManifestVersion: 2
> Bundle-Name: org.testx.impl
> Bundle-RequiredExecutionEnvironment: JavaSE-1.7
> Bundle-SymbolicName: org.test.org.testx.impl
> Bundle-Version: 1.0.0.SNAPSHOT
> Created-By: Apache Maven Bundle Plugin
> Import-Package: org.test;version="[1.0,2)"
> Private-Package: org.testx.impl
> Tool: Bnd-2.3.0.201405100607
> {code}
> The package import statement of "org.test.impl" misses the version, whereas the package import statement of "org.testx.impl" is correct.
> The issue does not exist in maven-bundle-plugin-2.4.0.
> This is a serious problem on my side. Can you fix it and release maven-bundle-plugin-2.5.3 quickly.
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
> 	<groupId>org.test</groupId>
> 	<artifactId>org.test.project</artifactId>
> 	<version>1.0.0-SNAPSHOT</version>
> 	<packaging>pom</packaging>
> 	<properties>
> 		<maven.compiler.source>1.7</maven.compiler.source>
> 		<maven.compiler.target>1.7</maven.compiler.target>
> 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> 	</properties>
> 	<modules>
> 		<module>org.test</module>
> 		<module>org.test.impl</module>
> 		<module>org.testx.impl</module>
> 	</modules>
> 	<dependencyManagement>
> 		<dependencies>
> 			<dependency>
> 				<groupId>org.test</groupId>
> 				<artifactId>org.test</artifactId>
> 				<version>${project.version}</version>
> 			</dependency>
> 			<dependency>
> 				<groupId>org.test</groupId>
> 				<artifactId>org.test.impl</artifactId>
> 				<version>${project.version}</version>
> 			</dependency>
> 			<dependency>
> 				<groupId>org.test</groupId>
> 				<artifactId>org.testx.impl</artifactId>
> 				<version>${project.version}</version>
> 			</dependency>
> 		</dependencies>
> 	</dependencyManagement>
> 	<build>
> 		<pluginManagement>
> 			<plugins>
> 				<plugin>
> 					<groupId>org.apache.maven.plugins</groupId>
> 					<artifactId>maven-compiler-plugin</artifactId>
> 					<version>3.2</version>
> 					<extensions>true</extensions>
> 					<configuration>
> 						<compilerId>eclipse</compilerId>
> 						<source>1.7</source>
> 						<target>1.7</target>
> 						<optimize>true</optimize>
> 					</configuration>
> 					<dependencies>
> 						<dependency>
> 							<groupId>org.codehaus.plexus</groupId>
> 							<artifactId>plexus-compiler-eclipse</artifactId>
> 							<version>2.5</version>
> 						</dependency>
> 					</dependencies>
> 				</plugin>
> 				<plugin>
> 					<groupId>org.apache.felix</groupId>
> 					<artifactId>maven-bundle-plugin</artifactId>
> 					<version>2.5.3</version>
> 					<extensions>true</extensions>
> 					<configuration>
> 						<manifestLocation>META-INF</manifestLocation>
> 						<instructions>
> 							<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
> 							<_nodefaultversion>false</_nodefaultversion>
> 							<_removeheaders>
> 								Provide-Capability,
> 								Require-Capability,
> 								Include-Resource
> 							</_removeheaders>
> 							<Bundle-Version>${project.version}</Bundle-Version>
> 							<Bundle-RequiredExecutionEnvironment>JavaSE-1.7</Bundle-RequiredExecutionEnvironment>
> 						</instructions>
> 					</configuration>
> 					<executions>
> 						<execution>
> 							<id>bundle-manifest</id>
> 							<phase>process-classes</phase>
> 							<goals>
> 								<goal>manifest</goal>
> 							</goals>
> 						</execution>
> 					</executions>
> 				</plugin>
> 			</plugins>
> 		</pluginManagement>
> 	</build>
> </project>
> {code}
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
> 	<artifactId>org.test</artifactId>
> 	<packaging>bundle</packaging>
> 	<parent>
> 		<groupId>org.test</groupId>
> 		<artifactId>org.test.project</artifactId>
> 		<version>1.0.0-SNAPSHOT</version>
> 		<relativePath>../</relativePath>
> 	</parent>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 			</plugin>
> 			<plugin>
> 				<groupId>org.apache.felix</groupId>
> 				<artifactId>maven-bundle-plugin</artifactId>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> {code}
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
> 	<artifactId>org.test.impl</artifactId>
> 	<packaging>bundle</packaging>
> 	<parent>
> 		<groupId>org.test</groupId>
> 		<artifactId>org.test.project</artifactId>
> 		<version>1.0.0-SNAPSHOT</version>
> 		<relativePath>../</relativePath>
> 	</parent>
> 	<dependencies>
> 		<dependency>
> 			<groupId>org.test</groupId>
> 			<artifactId>org.test</artifactId>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 			</plugin>
> 			<plugin>
> 				<groupId>org.apache.felix</groupId>
> 				<artifactId>maven-bundle-plugin</artifactId>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> {code}
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
> 	<artifactId>org.testx.impl</artifactId>
> 	<packaging>bundle</packaging>
> 	<parent>
> 		<groupId>org.test</groupId>
> 		<artifactId>org.test.project</artifactId>
> 		<version>1.0.0-SNAPSHOT</version>
> 		<relativePath>../</relativePath>
> 	</parent>
> 	<dependencies>
> 		<dependency>
> 			<groupId>org.test</groupId>
> 			<artifactId>org.test</artifactId>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 			</plugin>
> 			<plugin>
> 				<groupId>org.apache.felix</groupId>
> 				<artifactId>maven-bundle-plugin</artifactId>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> {code}
> {code}
> package org.test;
> public interface Test {
> }
> {code}
> {code}
> package org.test.impl;
> import org.test.Test;
> public class TestImpl implements Test { 
> }
> {code}
> {code}
> package org.testx.impl;
> import org.test.Test;
> public class TestxImpl implements Test {
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)