Hi guys,

We have a problem with the Maven-Bundle-Plugin. When we define a Declarative Service Component in the '.bnd'-file, we use a directive named 'servicefactory'. But the directive doesn't have an effect on the generated XML-Document for the DSC. I know that the plugin is based uppon the BND-Tool by Peter Kriens. So I used it to check if it generates the document I want. It does ( <service servicefactory='true'> ).

Do you know why the plugin ignores the directive?


In the following you see the definition of the DSC and the relevant part of the pom.xml.

#-----------------------------------------------------------------
# BND FILE
#-----------------------------------------------------------------
Export-Package: de.offis.utils.configSC;version=1.0.0.SNAPSHOT
Private-Package: de.offis.utils.configSC.internal;version=1.0.0.SNAPSHOT
Service-Component: de.offis.utils.configSC.internal.ConfigReaderImpl; \
   provide:=de.offis.utils.configSC.ConfigReader; \
   immediate:=false; \
   servicefactory:=true




#-----------------------------------------------------------------
# RELEVANT PART OF OUR POM.XML
#-----------------------------------------------------------------
 <build>
   <plugins>
     <!-- This is use for OSGi extention of the build script. -->
     <plugin>
       <groupId>org.ops4j</groupId>
       <artifactId>maven-pax-plugin</artifactId>
       <configuration>
         <provision>
           <param>--platform=equinox</param>
           <param>--profiles=minimal</param>
         </provision>
       </configuration>
     </plugin>
     <plugin>
       <groupId>org.apache.felix</groupId>
       <artifactId>maven-bundle-plugin</artifactId>
   <extensions>true</extensions>
       <!--
| the following instructions build a simple set of public/private classes into an OSGi bundle
       -->
       <configuration>
         <manifestLocation>META-INF</manifestLocation>
         <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>-->
         </instructions>
       </configuration>
     </plugin>
     <plugin>
       <artifactId>maven-clean-plugin</artifactId>
       <configuration>
         <filesets>
           <fileset>
             <directory>META-INF</directory>
           </fileset>
           <fileset>
             <directory>runner</directory>
           </fileset>
           <fileset>
             <directory>.</directory>
             <includes>
               <include>**/build.properties</include>
             </includes>
             <excludes>
               <exclude>**/*</exclude>
             </excludes>
           </fileset>
           <fileset>
             <directory>.settings</directory>
           </fileset>
         </filesets>
       </configuration>
     </plugin>
     <!-- Automation for test. -->
     <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>findbugs-maven-plugin</artifactId>
     </plugin>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-javadoc-plugin</artifactId>
       <configuration>
         <destDir>${target.javadoc}</destDir>
       </configuration>
       <executions>
         <execution>
           <phase>package</phase>
           <goals>
             <goal>javadoc</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
     <!--
| Include the compiler plugin. This will be used to setup the java source | and target version. Default the source and target version is set to 1.3
      | in this project we will use 1.6.
      -->
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <configuration>
         <source>1.6</source>
         <target>1.6</target>
       </configuration>
     </plugin>
   </plugins>
 </build>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to