简体   繁体   中英

How to create maven wab (war as osgi bundle) project in netbeans 7.4?

I am sorry if my question is so simple, but I can't find it in netbeans. Does such project exist? If no, how do you create it?

As I understand there are two ways - 1)create maven osgi project and then edit it or 2)create maven war project and then edit it. Which is better?

Not quite sure if this is what you really looking for, but you can package osgi bundles with maven-bundle-plugin . Downside is a sample for a basic project:

<project xmlns="http://maven.apache.org/POM/4.0.0"...>
  <groupId>some.group.id</groupId>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>sample</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>bundle</packaging>
  <name>Sample</name>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
              <Bundle-Name>${pom.name}</Bundle-Name>
              <Bundle-Version>${pom.version}</Bundle-Version>
              <Bundle-Activator>package.name.Activator</Bundle-Activator>
              <Private-Package>package.name.sample</Private-Package>
          </instructions>
        </configuration          
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.osgi.core</artifactId>
    </dependency>
  </dependencies>

</project>

Here you can refer to the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM