karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: bnd files in Decanter Project
Date Tue, 16 Feb 2016 09:29:36 GMT
On 16.02.2016 08:46, Guillaume Nodet wrote:
> Fwiw, if I had to do it again from scratch, I would not introduce
> properties for the OSGi bnd instructions again.
> The main reason is that the maven bundle plugin / bnd tools do make a
> difference between a property which is not set and a property which is
> empty.  When it's not set, it usually has a good default (for the most used
> properties).
> The default values are usually good ones, and it can be very difficult to
> overcome the fact that the parent plugin defines them as empty.
So if I interpret you correctly then we would not set properties in the 
parent pom like Lukasz proposed. I fully agree with you even if it makes 
the configs more verbose.
After rereading the example from Lukasz I found that he proposes to set 
the default exports like in Aries to export a package named like the 
groupId which is really bad.

>
> One thing I don't get is why in the original commit, the bnd instructions
> in the bnd file are actually different from the ones in the pom.  Any
> explanation ?
I checked what instructions are really needed and improved the bnd file 
to just set the minimum settings and leave as much on default as 
possible. That is why they are different.
I agree with you that we need to revert. The current votes like JB wrote 
speak clearly for a revert. I just talked to JB and he thinks we should 
wait one more day though.

As I think a simple revert will not work I would like to summarize what 
I will implement in reverting the bnd file change.


For the parent pom I would set the maven-bundle-plugin like below.
So I would simply remove the include for the bnd file as all other 
settings still make sense.

             <plugin>
                 <groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
                 <inherited>true</inherited>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                     </instructions>
                 </configuration>
                 <executions>
                     <execution>
                         <id>baseline</id>
                         <goals>
                             <goal>baseline</goal>
                         </goals>
                         <configuration>
<comparisonVersion>${baseline}</comparisonVersion>
<skip>${baseline.skip}</skip>
<failOnError>true</failOnError>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>

For each project I would remove the bnd file containing:
Export-Package: \
     org.apache.karaf.decanter.api,\
     org.apache.karaf.decanter.api.marshaller

and add a maven-bundle-plugin element like this:

     <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
                 <inherited>true</inherited>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
                         <Export-Package>
                             org.apache.karaf.decanter.api,
                             org.apache.karaf.decanter.api.marshaller
                         </Export-Package>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>


Is that fine for everyone?

Christian

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Mime
View raw message