You have "." in Bundle-ClassPath which does not make sense for a war...
On Thursday 11 November 2010 12:10 AM, Charles Moulliard wrote:
Here is the config that I use to generate my WAR file
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
....
<name>x3s-web</name>
<packaging>war</packaging>
<build>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<!-- to generate the MANIFEST-FILE required by the bundle -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-maven-plugin-version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
<supportedProjectTypes>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-ClassPath>
.,
WEB-INF/classes
</Bundle-ClassPath>
<Webapp-Context>MyProject</Webapp-Context>
<_failok>true</_failok>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-alpha-2</version>
<configuration>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
<archive>
<!-- add the generated manifest to the war -->
<manifestFile>META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
On 10/11/10 16:18, Guillaume Nodet wrote:
RIght, I suppose one way would be to put the code in a separate maven
module and embed it in WEB-INF/lib, or inline it in WEB-INF/classes.
Not sure if it would really help with the osgi metada generation
though.
On Wed, Nov 10, 2010 at 15:59, Alasdair Nottingham<[email protected]>
wrote:
True, but that is a bad idea as your classes will then be web
accessible which is likely to be a security exposure.
Alasdair
On 10 Nov 2010, at 14:51, Guillaume Nodet<[email protected]> wrote:
Note that if you're building a WAB, you don't need the WEB-INF/classes
and WEB-INF/lib, you can simply have them in the root and not export
them. The location is significant in JEE, but not in OSGi.
On Wed, Nov 10, 2010 at 15:47, Michael Prieß
<[email protected]> wrote:
After reading the OSGi Enterprise 4.2 part over Web Archive
Bundles (WAB). I
started to change the pom.xml packaging from war into bundle.
Added the
maven-bundle-plugin and the maven-war-plugin to get the manifest
after
generation into the war.
Generating the import and exports with the packaging bundle works
fine, but
i have a problem to add the Bundle-ClassPath to the manifest. If i
uncomment
the Bundle-ClassPath i get the following error:
"Cannot find a file or directory for Bundle-Classpath entry:
WEB-INF/classes"
I comprehend why the bundle-plugin throw this error. But how did i
get the
Bundle-Classpath into my manifest ? I tried something around with
Peter
Kriens BND Tool which provide some directives wab and wablib but
nothing
happen and im not sure if i use this directives right.
If i use as packaging war manifest generation with
Bundle-Classpath works
fine, but export and imports are not complete. Know anyone a
solution how to
resolve this problem ?
Part of my pom.xml:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>${project.build.directory}/MANIFEST/</manifestLocation>
<excludeDependencies>*;scope=provided</excludeDependencies>
<instructions>
<!--<Import-Package>*</Import-Package> -->
<Export-Package>!*</Export-Package>
<!--
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath> -->
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<_wab></_wab>
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
<!--<Web-ContextPath>geoserver</Web-ContextPath>
<Webapp-Context>geoserver</Webapp-Context> -->
</instructions>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
Cheers,
Michael
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]