mirror of https://github.com/apache/maven.git
Move osgi bundle manifest generation to osgi profile.
The generated manifests are incorrect, for instance, maven-project's manifest misses the package-import org.apache.maven.artifact.transform which should come from maven-artifact CacheAware*.java. Further, this doesn't work in an osgi environment, since if each artifact is a bundle, then maven-embedder must have access to all component.xml files in all maven core artifacts, and in all dependencies (which aren't bundles but that can be fixed). Osgi import/exports for packages work for resources too, but META-INF/ isn't a package so this doesn't work. This may work with 'Require-Bundle' (it does in my implementation although i don't think i follow the spec entirely ;)). The next problem you get is classcasts for wagon (httplightweightwagon). This has to be included in a bundle too and get proper exports. The same goes for all other dependencies (plexus-*). Maven and plexus are not suited for osgi yet - too much changing is required in both the metadata structure, the code, and all dependencies and/or packaging and binary inclusion of dependencies to make this work. The best bet is to use the one-artifact embedder. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@549982 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f479a38620
commit
e54695ddba
57
pom.xml
57
pom.xml
|
@ -103,30 +103,6 @@ under the License.
|
|||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<!-- if plugin not released at maven release time the manifests generated could be checked in by hand -->
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>0.9.0-incubator-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Needed for including the manifest, see MJAR-71 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
|
@ -258,6 +234,39 @@ under the License.
|
|||
</pluginRepositories>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>osgi</id>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!-- if plugin not released at maven release time the manifests generated could be checked in by hand -->
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>0.9.0-incubator-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Needed for including the manifest, see MJAR-71 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
|
|
Loading…
Reference in New Issue