OK, to summarize, in order to get Spring DM 1.1.0 and PAX to work with a bundle that should be a .war and not a .jar, there are three problems:
1. Using "war" packaging and still get benefits of the maven-bundle-plugin. 2. Get pax-provision to automatically provision a local "war" project. 3. Get pax-runner to keep source file extension in local bundle cache. I realize that most of these problems may appear created by the somewhat unfortunate change in the Spring DM 1.1.0 war scanner, but perhaps we can use this as an excuse to make the PAX tools even better. Who knows, we might someday really need a pax-provison and a pax-runner that can deploy other files than .jar. Here is a solution to the first of the three problems: If your project is packaged as "war" you can still use the maven-bundle-plugin to generate the manifest if you add "war" to supportedProjectTypes: <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <supportedProjectTypes> <supportedProjectType>jar</supportedProjectType> <supportedProjectType>bundle</supportedProjectType> * <supportedProjectType>war</supportedProjectType> * </supportedProjectTypes> Here is the configuration I use for generating a manifest using BND and adding it to the WAR: <properties> <bundle.symbolicName>myartifact</bundle.symbolicName> <bundle.namespace>myartifact</bundle.namespace> </properties> <modelVersion>4.0.0</modelVersion> <groupId>mygroup</groupId> <artifactId>myartifact</artifactId> <version>1.0-SNAPSHOT</version> <name>${bundle.symbolicName}</name> * <packaging>war</packaging> * <build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <!-- add the generated manifest to the war --> <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <executions> <execution> <id>bundle-manifest</id> <phase>process-classes</phase> <goals> <goal>manifest</goal> </goals> </execution> </executions> <configuration> <supportedProjectTypes> <supportedProjectType>jar</supportedProjectType> <supportedProjectType>bundle</supportedProjectType> * <supportedProjectType>war</supportedProjectType> * </supportedProjectTypes> <instructions> <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName> <Bundle-Version>${pom.version}</Bundle-Version> <!-- | assume public classes are in the top package, and private classes are under ".internal" --> <Export-Package>!${bundle.namespace}.internal.*,${bundle.namespace}.*;version="${pom.version}"</Export-Package> <Private-Package>${bundle.namespace}.internal.*</Private-Package> <!-- | each module can override these defaults in their osgi.bnd file --> <_include>-osgi.bnd</_include> </instructions> </configuration> </plugin> </plugins> </build> So now we can get a bundle with a BND-generated manifest installed in the repo as a .war. Unless I specifically tell pax-provision to deploy the .war, it won't be picked up: mvn clean install pax:provision * -DdeployURLs=mvn:mygroup/myartifact/1.0-SNAPSHOT/war* The problem with pax-runner still exists, in that it reads the .war from the repo as a stream and places it in the local cache (./runner/bundles) as a .jar. It will be installed from the cache as a .jar, so it still won't get deployed to the web container by Spring DM 1.1.0. -- Ulrik
_______________________________________________ general mailing list general@lists.ops4j.org http://lists.ops4j.org/mailman/listinfo/general