0

I am developing a plugin for the OSGI application, using maven to compile. In order to install the plugin, the OSGI application should read the information about plugin dependencies. This information should be provided in the MANIFEST.MF file. What I'm wondering is how to use Virgo Tooling to generate a proper MANIFEST.MF file.

These are the dependencies I would like to include in the MANIFEST.MF enter image description here

UPDATE According to the answer I used the Apache Felix

To the pom.xml I have added

<plugin>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>  
      <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>
</plugin>

downloaded the maven-bundle.jar and executed the command mvn org.apache.felix:maven-bundle-plugin:manifest which produced the .jar file with the manifest, but manifest contained only following infromation

Manifest-Version: 1.0
Implementation-Vendor: The Apache Software Foundation
Implementation-Title: Maven Bundle Plugin
Implementation-Version: 3.2.0
Implementation-Vendor-Id: org.apache.felix
Built-By: cziegeler
Build-Jdk: 1.7.0_80
Specification-Vendor: The Apache Software Foundation
Specification-Title: Maven Bundle Plugin
Created-By: Apache Maven 3.3.9
Specification-Version: 3.2.0
Archiver-Version: Plexus Archiver

Any ideas what I did wrong?

mr. Holiday
  • 1,780
  • 2
  • 19
  • 37

1 Answers1

2

Personally, I would generate the MANIFEST.MF file with Apache Felix Maven Bundle Plugin

Try to add some configuration to the plugin in the project's pom.xml file.

Here's a start, but you should read the documentation and find the correct instructions that will fit your precise need. It would be helpful if you could provide an example of MANIFEST.MF file.

<plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>3.2.0</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                </instructions>
            </configuration>
            <executions>
                <execution>
                    <id>generate-manifest</id>
                    <goals>
                        <goal>manifest</goal>
                    </goals>
                    <phase>generate-resources</phase>
                </execution>
            </executions>
        </plugin>

With this kind of config, the MANIFEST.MF will be generated during 'generate-resources' phase.

Gauthier JACQUES
  • 655
  • 5
  • 15
  • Could you please add more details about the solution you provide? – abarisone Jul 28 '16 at 12:05
  • Have a look at the "manifest" goal here : http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html#adding-osgi-metadata-to-existing-projects-without-changing-the-packaging-type – Gauthier JACQUES Jul 28 '16 at 12:16