You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Sahoo <sa...@oracle.com> on 2011/04/22 04:34:37 UTC
How to avoid "." in Bundle-ClassPath while using maven-bundle-plugin
to build WAB
Hi,
I want to build a WAB using maven-bundle-plugin. My WAB will include
some dependencies in WEB-INF/lib and the immediate classes in
WEB-INF/classes/. I have an additional requirement that Bundle-ClassPath
must not include ".", as it does not make sense for a WAB. I had issues
using maven-bundle-plugin to build such WABs in the past as discussed in
[1]. I thought I would be able to overcode those issues with *-wab*
instructions of new bnd, but I am not. /Should bnd not remove "." from
Bundle-ClassPath when it sees *-wab* instruction?/ Given below is an
entire pom.xml and the generated manifest.
Thanks,
Sahoo
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sahoo.osgisamples</groupId>
<artifactId>bundleplugin.wab-with-webinflib-1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Bundle plugin sample demonstrating building of a WAB with
WEB-INF/lib</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.2.0</version>
<extensions>true</extensions>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<_wab>src/main/webapp</_wab>
<Web-ContextPath>/test</Web-ContextPath>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-bundle</id>
<phase>package</phase>
<inherited>false</inherited>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>sahoo.osgisamples</groupId>
<artifactId>entities1</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
[MANIFEST bundleplugin.wab-with-webinflib-1-1.0-SNAPSHOT.jar]
Bnd-LastModified 1303438835114
Build-Jdk 1.6.0_21
Built-By ss141213
Bundle-ClassPath
WEB-INF/classes,.,WEB-INF/lib/entities1-1.0-SNAPSHOT.jar
Bundle-ManifestVersion 2
Bundle-Name Bundle plugin sample
demonstrating building of a WAB with WEB-INF/lib
Bundle-SymbolicName
sahoo.osgisamples.bundleplugin.wab-with-webinflib-1
Bundle-Version 1.0.0.SNAPSHOT
Class-Path
Created-By Apache Maven Bundle Plugin
Embed-Dependency *;scope=compile;inline=false
Embed-Directory WEB-INF/lib
Export-Package sahoo.samples.sample_wab1.api
Import-Package
javax.annotation,javax.ejb.embeddable,javax.persistence,javax.servlet,javax.servlet.annotation,javax.servlet.http,javax.transaction
Manifest-Version 1.0
Tool Bnd-1.15.0
Web-ContextPath /test
Re: How to avoid "." in Bundle-ClassPath while using maven-bundle-plugin to build WAB
Posted by Stuart McCulloch <mc...@gmail.com>.
On 6 May 2011, at 16:33, Peter Kriens wrote:
> Sorry for the delay, I was walking in the mountains of France oblivious of any bnd problems :-)
>
> I think the problem is in the maven plugin, I think Stuart has to have a look. The -wab and -wablib options augment the class path but do not add a '.'. So my conclusion is that the maven plugin must set the Bundle-Classpath for some reason ahead of time. The -wab(lib) options then just add their stuff to it.
yes - took a quick at the code in trunk, it seems that the DependencyEmbedder adds '.' when assembling the embedded classpath (the pom below embeds dependencies)
you could try setting <Bundle-ClassPath>{maven-dependencies}</Bundle-ClassPath> as a workaround, I think this should avoid the code path that adds the default '.' entry
> I made some examples for -wab(lib) in bndtools: https://github.com/bnd/aQute/tree/master/aQute.waboption
>
> So Stuart?
>
> Then again, I do not think this causes any problems and it has the advantage that you do getResource() on the resources in your wab which can be convenient.
>
> Kind regards,
>
> Peter Kriens
>
>
>
> On 26 apr 2011, at 07:21, Sahoo wrote:
>
>> Any input?
>>
>> On Friday 22 April 2011 08:04 AM, Sahoo wrote:
>>> Hi,
>>>
>>> I want to build a WAB using maven-bundle-plugin. My WAB will include some dependencies in WEB-INF/lib and the immediate classes in WEB-INF/classes/. I have an additional requirement that Bundle-ClassPath must not include ".", as it does not make sense for a WAB. I had issues using maven-bundle-plugin to build such WABs in the past as discussed in [1]. I thought I would be able to overcode those issues with *-wab* instructions of new bnd, but I am not. /Should bnd not remove "." from Bundle-ClassPath when it sees *-wab* instruction?/ Given below is an entire pom.xml and the generated manifest.
>>>
>>> Thanks,
>>> Sahoo
>>>
>>> <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/xsd/maven-4.0.0.xsd">
>>> <modelVersion>4.0.0</modelVersion>
>>> <groupId>sahoo.osgisamples</groupId>
>>> <artifactId>bundleplugin.wab-with-webinflib-1</artifactId>
>>> <version>1.0-SNAPSHOT</version>
>>> <packaging>bundle</packaging>
>>>
>>> <name>Bundle plugin sample demonstrating building of a WAB with WEB-INF/lib</name>
>>> <build>
>>> <plugins>
>>> <plugin>
>>> <groupId>org.apache.felix</groupId>
>>> <artifactId>maven-bundle-plugin</artifactId>
>>> <version>2.2.0</version>
>>> <extensions>true</extensions>
>>> <configuration>
>>> <supportedProjectTypes>
>>> <supportedProjectType>jar</supportedProjectType>
>>> <supportedProjectType>war</supportedProjectType>
>>> <supportedProjectType>bundle</supportedProjectType>
>>> </supportedProjectTypes>
>>> <instructions>
>>> <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
>>> <Embed-Directory>WEB-INF/lib</Embed-Directory>
>>> <_wab>src/main/webapp</_wab>
>>> <Web-ContextPath>/test</Web-ContextPath>
>>> </instructions>
>>> </configuration>
>>> <executions>
>>> <execution>
>>> <id>bundle-bundle</id>
>>> <phase>package</phase>
>>> <inherited>false</inherited>
>>> <goals>
>>> <goal>bundle</goal>
>>> </goals>
>>> </execution>
>>> </executions>
>>> </plugin>
>>> <plugin>
>>> <artifactId>maven-compiler-plugin</artifactId>
>>> <configuration>
>>> <source>1.6</source>
>>> <target>1.6</target>
>>> </configuration>
>>> </plugin>
>>> <plugin>
>>> <artifactId>maven-war-plugin</artifactId>
>>> <version>2.1</version>
>>> <configuration>
>>> <failOnMissingWebXml>false</failOnMissingWebXml>
>>> </configuration>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> <dependencies>
>>> <dependency>
>>> <groupId>sahoo.osgisamples</groupId>
>>> <artifactId>entities1</artifactId>
>>> <version>1.0-SNAPSHOT</version>
>>> <type>jar</type>
>>> <scope>compile</scope>
>>> </dependency>
>>> <dependency>
>>> <groupId>javax</groupId>
>>> <artifactId>javaee-web-api</artifactId>
>>> <version>6.0</version>
>>> <scope>provided</scope>
>>> </dependency>
>>> </dependencies>
>>>
>>> </project>
>>>
>>> [MANIFEST bundleplugin.wab-with-webinflib-1-1.0-SNAPSHOT.jar]
>>> Bnd-LastModified 1303438835114
>>> Build-Jdk 1.6.0_21
>>> Built-By ss141213
>>> Bundle-ClassPath WEB-INF/classes,.,WEB-INF/lib/entities1-1.0-SNAPSHOT.jar
>>> Bundle-ManifestVersion 2
>>> Bundle-Name Bundle plugin sample demonstrating building of a WAB with WEB-INF/lib
>>> Bundle-SymbolicName sahoo.osgisamples.bundleplugin.wab-with-webinflib-1
>>> Bundle-Version 1.0.0.SNAPSHOT
>>> Class-Path
>>> Created-By Apache Maven Bundle Plugin
>>> Embed-Dependency *;scope=compile;inline=false
>>> Embed-Directory WEB-INF/lib
>>> Export-Package sahoo.samples.sample_wab1.api
>>> Import-Package javax.annotation,javax.ejb.embeddable,javax.persistence,javax.servlet,javax.servlet.annotation,javax.servlet.http,javax.transaction
>>> Manifest-Version 1.0
>>> Tool Bnd-1.15.0
>>> Web-ContextPath /test
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: How to avoid "." in Bundle-ClassPath while using maven-bundle-plugin to build WAB
Posted by Peter Kriens <pe...@aqute.biz>.
Sorry for the delay, I was walking in the mountains of France oblivious of any bnd problems :-)
I think the problem is in the maven plugin, I think Stuart has to have a look. The -wab and -wablib options augment the class path but do not add a '.'. So my conclusion is that the maven plugin must set the Bundle-Classpath for some reason ahead of time. The -wab(lib) options then just add their stuff to it.
I made some examples for -wab(lib) in bndtools: https://github.com/bnd/aQute/tree/master/aQute.waboption
So Stuart?
Then again, I do not think this causes any problems and it has the advantage that you do getResource() on the resources in your wab which can be convenient.
Kind regards,
Peter Kriens
On 26 apr 2011, at 07:21, Sahoo wrote:
> Any input?
>
> On Friday 22 April 2011 08:04 AM, Sahoo wrote:
>> Hi,
>>
>> I want to build a WAB using maven-bundle-plugin. My WAB will include some dependencies in WEB-INF/lib and the immediate classes in WEB-INF/classes/. I have an additional requirement that Bundle-ClassPath must not include ".", as it does not make sense for a WAB. I had issues using maven-bundle-plugin to build such WABs in the past as discussed in [1]. I thought I would be able to overcode those issues with *-wab* instructions of new bnd, but I am not. /Should bnd not remove "." from Bundle-ClassPath when it sees *-wab* instruction?/ Given below is an entire pom.xml and the generated manifest.
>>
>> Thanks,
>> Sahoo
>>
>> <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/xsd/maven-4.0.0.xsd">
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>sahoo.osgisamples</groupId>
>> <artifactId>bundleplugin.wab-with-webinflib-1</artifactId>
>> <version>1.0-SNAPSHOT</version>
>> <packaging>bundle</packaging>
>>
>> <name>Bundle plugin sample demonstrating building of a WAB with WEB-INF/lib</name>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.felix</groupId>
>> <artifactId>maven-bundle-plugin</artifactId>
>> <version>2.2.0</version>
>> <extensions>true</extensions>
>> <configuration>
>> <supportedProjectTypes>
>> <supportedProjectType>jar</supportedProjectType>
>> <supportedProjectType>war</supportedProjectType>
>> <supportedProjectType>bundle</supportedProjectType>
>> </supportedProjectTypes>
>> <instructions>
>> <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
>> <Embed-Directory>WEB-INF/lib</Embed-Directory>
>> <_wab>src/main/webapp</_wab>
>> <Web-ContextPath>/test</Web-ContextPath>
>> </instructions>
>> </configuration>
>> <executions>
>> <execution>
>> <id>bundle-bundle</id>
>> <phase>package</phase>
>> <inherited>false</inherited>
>> <goals>
>> <goal>bundle</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>> <plugin>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <configuration>
>> <source>1.6</source>
>> <target>1.6</target>
>> </configuration>
>> </plugin>
>> <plugin>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.1</version>
>> <configuration>
>> <failOnMissingWebXml>false</failOnMissingWebXml>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> <dependencies>
>> <dependency>
>> <groupId>sahoo.osgisamples</groupId>
>> <artifactId>entities1</artifactId>
>> <version>1.0-SNAPSHOT</version>
>> <type>jar</type>
>> <scope>compile</scope>
>> </dependency>
>> <dependency>
>> <groupId>javax</groupId>
>> <artifactId>javaee-web-api</artifactId>
>> <version>6.0</version>
>> <scope>provided</scope>
>> </dependency>
>> </dependencies>
>>
>> </project>
>>
>> [MANIFEST bundleplugin.wab-with-webinflib-1-1.0-SNAPSHOT.jar]
>> Bnd-LastModified 1303438835114
>> Build-Jdk 1.6.0_21
>> Built-By ss141213
>> Bundle-ClassPath WEB-INF/classes,.,WEB-INF/lib/entities1-1.0-SNAPSHOT.jar
>> Bundle-ManifestVersion 2
>> Bundle-Name Bundle plugin sample demonstrating building of a WAB with WEB-INF/lib
>> Bundle-SymbolicName sahoo.osgisamples.bundleplugin.wab-with-webinflib-1
>> Bundle-Version 1.0.0.SNAPSHOT
>> Class-Path
>> Created-By Apache Maven Bundle Plugin
>> Embed-Dependency *;scope=compile;inline=false
>> Embed-Directory WEB-INF/lib
>> Export-Package sahoo.samples.sample_wab1.api
>> Import-Package javax.annotation,javax.ejb.embeddable,javax.persistence,javax.servlet,javax.servlet.annotation,javax.servlet.http,javax.transaction
>> Manifest-Version 1.0
>> Tool Bnd-1.15.0
>> Web-ContextPath /test
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: How to avoid "." in Bundle-ClassPath while using maven-bundle-plugin
to build WAB
Posted by Sahoo <sa...@oracle.com>.
Any input?
On Friday 22 April 2011 08:04 AM, Sahoo wrote:
> Hi,
>
> I want to build a WAB using maven-bundle-plugin. My WAB will include
> some dependencies in WEB-INF/lib and the immediate classes in
> WEB-INF/classes/. I have an additional requirement that
> Bundle-ClassPath must not include ".", as it does not make sense for a
> WAB. I had issues using maven-bundle-plugin to build such WABs in the
> past as discussed in [1]. I thought I would be able to overcode those
> issues with *-wab* instructions of new bnd, but I am not. /Should bnd
> not remove "." from Bundle-ClassPath when it sees *-wab* instruction?/
> Given below is an entire pom.xml and the generated manifest.
>
> Thanks,
> Sahoo
>
> <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/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>sahoo.osgisamples</groupId>
> <artifactId>bundleplugin.wab-with-webinflib-1</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>bundle</packaging>
>
> <name>Bundle plugin sample demonstrating building of a WAB with
> WEB-INF/lib</name>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <version>2.2.0</version>
> <extensions>true</extensions>
> <configuration>
> <supportedProjectTypes>
> <supportedProjectType>jar</supportedProjectType>
> <supportedProjectType>war</supportedProjectType>
> <supportedProjectType>bundle</supportedProjectType>
> </supportedProjectTypes>
> <instructions>
> <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
> <Embed-Directory>WEB-INF/lib</Embed-Directory>
> <_wab>src/main/webapp</_wab>
> <Web-ContextPath>/test</Web-ContextPath>
> </instructions>
> </configuration>
> <executions>
> <execution>
> <id>bundle-bundle</id>
> <phase>package</phase>
> <inherited>false</inherited>
> <goals>
> <goal>bundle</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.1</version>
> <configuration>
> <failOnMissingWebXml>false</failOnMissingWebXml>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>sahoo.osgisamples</groupId>
> <artifactId>entities1</artifactId>
> <version>1.0-SNAPSHOT</version>
> <type>jar</type>
> <scope>compile</scope>
> </dependency>
> <dependency>
> <groupId>javax</groupId>
> <artifactId>javaee-web-api</artifactId>
> <version>6.0</version>
> <scope>provided</scope>
> </dependency>
> </dependencies>
>
> </project>
>
> [MANIFEST bundleplugin.wab-with-webinflib-1-1.0-SNAPSHOT.jar]
> Bnd-LastModified 1303438835114
> Build-Jdk 1.6.0_21
> Built-By ss141213
> Bundle-ClassPath
> WEB-INF/classes,.,WEB-INF/lib/entities1-1.0-SNAPSHOT.jar
> Bundle-ManifestVersion 2
> Bundle-Name Bundle plugin sample
> demonstrating building of a WAB with WEB-INF/lib
> Bundle-SymbolicName
> sahoo.osgisamples.bundleplugin.wab-with-webinflib-1
> Bundle-Version 1.0.0.SNAPSHOT
> Class-Path
> Created-By Apache Maven Bundle Plugin
> Embed-Dependency *;scope=compile;inline=false
> Embed-Directory WEB-INF/lib
> Export-Package sahoo.samples.sample_wab1.api
> Import-Package
> javax.annotation,javax.ejb.embeddable,javax.persistence,javax.servlet,javax.servlet.annotation,javax.servlet.http,javax.transaction
> Manifest-Version 1.0
> Tool Bnd-1.15.0
> Web-ContextPath /test
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org