You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by duan2ping DL• <du...@gmail.com> on 2019/08/06 08:36:55 UTC

Questions about Export-Package

Hi!

I have some questions about Export-Package.

Example:

<plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
                    <instructions>
                    <Export-Package>
com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"
                    </Export-Package>
                        ......
                       </instructions>
                </configuration>
 </plugin>
[image: Selection_117.png]
①  Why "include=" and "include:=" are right ,But exclude can only be ":="
②  The plugin display is
"exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"" ,But the
"header bundle ID" shows
"exclude:=*Dao;include="*Service,*Activetor,*Info,ShellTable"".
Missing " " symbol.

best regards
duan

Re: Questions about Export-Package

Posted by duan2ping DL• <du...@gmail.com>.
Hi Robert.Thank you very much for your reply!

Robert Munteanu <ro...@apache.org> 于2019年8月6日周二 下午5:52写道:

> Hi Duan,
>
> On Tue, 2019-08-06 at 16:57 +0800, duan2ping DL• wrote:
> > Hi Robert.Thank you very much!
> > Is this configuration wrong?
> > There are such specifications in OSGi.
> >
> https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#i3106983
>
> I stand corrected then :-) I had no idea this was possible.
>
> Robert
>
> >
> > Robert Munteanu <ro...@apache.org> 于2019年8月6日周二 下午4:40写道:
> >
> > > Hi Duan,
> > >
> > > On Tue, 2019-08-06 at 16:36 +0800, duan2ping DL• wrote:
> > > > Hi!
> > > >
> > > > I have some questions about Export-Package.
> > > >
> > > > Example:
> > > >
> > > > <plugin>
> > > >            <groupId>org.apache.felix</groupId>
> > > >            <artifactId>maven-bundle-plugin</artifactId>
> > > >             <configuration>
> > > >                     <instructions>
> > > >                     <Export-Package>
> > > > com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Active
> > > > tor,
> > > > *Info,ShellTable"
> > > >                     </Export-Package>
> > > >                         ......
> > > >                        </instructions>
> > > >                 </configuration>
> > > >  </plugin>
> > >
> > > (snip)
> > >
> > > I don't have answers to your specific questions, but you can not
> > > import
> > > or export parts of a package. In OSGi as package is either exported
> > > or
> > > it's not.
> > >
> > > Hope this helps,
> > >
> > > Robert
> > >
> > >
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Questions about Export-Package

Posted by Robert Munteanu <ro...@apache.org>.
Hi Duan,

On Tue, 2019-08-06 at 16:57 +0800, duan2ping DL• wrote:
> Hi Robert.Thank you very much!
> Is this configuration wrong?
> There are such specifications in OSGi.
> https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#i3106983

I stand corrected then :-) I had no idea this was possible.

Robert

> 
> Robert Munteanu <ro...@apache.org> 于2019年8月6日周二 下午4:40写道:
> 
> > Hi Duan,
> > 
> > On Tue, 2019-08-06 at 16:36 +0800, duan2ping DL• wrote:
> > > Hi!
> > > 
> > > I have some questions about Export-Package.
> > > 
> > > Example:
> > > 
> > > <plugin>
> > >            <groupId>org.apache.felix</groupId>
> > >            <artifactId>maven-bundle-plugin</artifactId>
> > >             <configuration>
> > >                     <instructions>
> > >                     <Export-Package>
> > > com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Active
> > > tor,
> > > *Info,ShellTable"
> > >                     </Export-Package>
> > >                         ......
> > >                        </instructions>
> > >                 </configuration>
> > >  </plugin>
> > 
> > (snip)
> > 
> > I don't have answers to your specific questions, but you can not
> > import
> > or export parts of a package. In OSGi as package is either exported
> > or
> > it's not.
> > 
> > Hope this helps,
> > 
> > Robert
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> > 
> > 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Questions about Export-Package

Posted by duan2ping DL• <du...@gmail.com>.
Hi Robert.Thank you very much!
Is this configuration wrong?
There are such specifications in OSGi.
https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#i3106983

Robert Munteanu <ro...@apache.org> 于2019年8月6日周二 下午4:40写道:

> Hi Duan,
>
> On Tue, 2019-08-06 at 16:36 +0800, duan2ping DL• wrote:
> > Hi!
> >
> > I have some questions about Export-Package.
> >
> > Example:
> >
> > <plugin>
> >            <groupId>org.apache.felix</groupId>
> >            <artifactId>maven-bundle-plugin</artifactId>
> >             <configuration>
> >                     <instructions>
> >                     <Export-Package>
> > com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,
> > *Info,ShellTable"
> >                     </Export-Package>
> >                         ......
> >                        </instructions>
> >                 </configuration>
> >  </plugin>
>
> (snip)
>
> I don't have answers to your specific questions, but you can not import
> or export parts of a package. In OSGi as package is either exported or
> it's not.
>
> Hope this helps,
>
> Robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Questions about Export-Package

Posted by Robert Munteanu <ro...@apache.org>.
Hi Duan,

On Tue, 2019-08-06 at 16:36 +0800, duan2ping DL• wrote:
> Hi!
> 
> I have some questions about Export-Package.
> 
> Example:
> 
> <plugin>
>            <groupId>org.apache.felix</groupId>
>            <artifactId>maven-bundle-plugin</artifactId>
>             <configuration>
>                     <instructions>      
>                     <Export-Package>
> com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,
> *Info,ShellTable"
>                     </Export-Package>        
>                         ......
>                        </instructions>
>                 </configuration>
>  </plugin>

(snip)

I don't have answers to your specific questions, but you can not import
or export parts of a package. In OSGi as package is either exported or
it's not.

Hope this helps,

Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Fwd: Questions about Export-Package

Posted by duan2ping DL• <du...@gmail.com>.
Thanks JB

I also never use include / exclude in the export-package instruction.
I see this feature in the OSGi specification, I tried it and found this
problem.

Jean-Baptiste Onofré <jb...@nanthrax.net> 于2019年8月13日周二 下午2:18写道:

> Hi,
>
> You can take a look on the updated documentation of the
> maven-bundle-plugin:
>
>
> http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html
>
> I never use include/exclude in export-package instruction as it's
> related to the source.
>
> Regards
> JB
>
> On 13/08/2019 05:11, duan2ping DL• wrote:
> > Hi!
> >
> > I have some questions about Export-Package.
> >
> > Example:
> >
> > <plugin>
> >            <groupId>org.apache.felix</groupId>
> >            <artifactId>maven-bundle-plugin</artifactId>
> >             <configuration>
> >                     <instructions>
> >                     <Export-Package>
> >
> com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"
> >                     </Export-Package>
> >                         ......
> >                        </instructions>
> >                 </configuration>
> >  </plugin>
> > Selection_117.png
> > ①  Why "include=" and "include:=" are right ,But exclude can only be ":="
> > ②  The plugin display is
> > "exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"" ,But
> > the "header bundle ID" shows
> > "exclude:=*Dao;include="*Service,*Activetor,*Info,ShellTable"".
> > Missing " " symbol.
> >
> > best regards
> > duan
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Fwd: Questions about Export-Package

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

You can take a look on the updated documentation of the maven-bundle-plugin:

http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html

I never use include/exclude in export-package instruction as it's
related to the source.

Regards
JB

On 13/08/2019 05:11, duan2ping DL• wrote:
> Hi!
> 
> I have some questions about Export-Package.
> 
> Example:
> 
> <plugin>
>            <groupId>org.apache.felix</groupId>
>            <artifactId>maven-bundle-plugin</artifactId>
>             <configuration>
>                     <instructions>      
>                     <Export-Package>
> com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"
>                     </Export-Package>        
>                         ......
>                        </instructions>
>                 </configuration>
>  </plugin>
> Selection_117.png
> ①  Why "include=" and "include:=" are right ,But exclude can only be ":="
> ②  The plugin display is
> "exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"" ,But
> the "header bundle ID" shows
> "exclude:=*Dao;include="*Service,*Activetor,*Info,ShellTable"".
> Missing " " symbol.
> 
> best regards
> duan

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Questions about Export-Package

Posted by duan2ping DL• <du...@gmail.com>.
Hi Stephan

I agree with you. But "include=" is  correct,Make me confused.

Siano, Stephan <st...@sap.com> 于2019年8月13日周二 下午3:47写道:

> Hi,
>
>
>
> According to the OSGi core spec include and exclude are directives, so
> they should always go with “:=”. The quotes should only be necessary if the
> value contains a comma character, so from my interpretation of the OSGi
> spec "exclude:=*Dao;include:="*Service,*Activetor,*Info,ShellTable"" should
> be the correct syntax. However I have never used include and exclude
> directives myself.
>
>
>
> Best regards
>
> Stephan
>
>
>
> *From:* duan2ping DL• <du...@gmail.com>
> *Sent:* Dienstag, 13. August 2019 05:12
> *To:* user@karaf.apache.org
> *Subject:* Fwd: Questions about Export-Package
>
>
>
> Hi!
>
> I have some questions about Export-Package.
>
> Example:
>
>
>
> <plugin>
>            <groupId>org.apache.felix</groupId>
>
>            <artifactId>maven-bundle-plugin</artifactId>
>             <configuration>
>
>                     <instructions>
>
>                     <Export-Package>
> com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"
>
>                     </Export-Package>
>
>                         ......
>
>                        </instructions>
>                 </configuration>
>  </plugin>
>
> [image: Selection_117.png]
>
> ①  Why "include=" and "include:=" are right ,But exclude can only be ":="
>
> ②  The plugin display is
> "exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"" ,But the
> "header bundle ID" shows
> "exclude:=*Dao;include="*Service,*Activetor,*Info,ShellTable"".
>
> Missing " " symbol.
>
>
>
> best regards
>
> duan
>

RE: Questions about Export-Package

Posted by "Siano, Stephan" <st...@sap.com>.
Hi,

According to the OSGi core spec include and exclude are directives, so they should always go with “:=”. The quotes should only be necessary if the value contains a comma character, so from my interpretation of the OSGi spec "exclude:=*Dao;include:="*Service,*Activetor,*Info,ShellTable"" should be the correct syntax. However I have never used include and exclude directives myself.

Best regards
Stephan

From: duan2ping DL• <du...@gmail.com>
Sent: Dienstag, 13. August 2019 05:12
To: user@karaf.apache.org
Subject: Fwd: Questions about Export-Package

Hi!

I have some questions about Export-Package.

Example:

<plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
                    <instructions>
                    <Export-Package> com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"
                    </Export-Package>
                        ......
                       </instructions>
                </configuration>
 </plugin>
[Selection_117.png]
①  Why "include=" and "include:=" are right ,But exclude can only be ":="
②  The plugin display is "exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"" ,But the "header bundle ID" shows "exclude:=*Dao;include="*Service,*Activetor,*Info,ShellTable"".
Missing " " symbol.

best regards
duan

Fwd: Questions about Export-Package

Posted by duan2ping DL• <du...@gmail.com>.
Hi!

I have some questions about Export-Package.

Example:

<plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
                    <instructions>
                    <Export-Package>
com.duan2ping.api.model;exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"
                    </Export-Package>
                        ......
                       </instructions>
                </configuration>
 </plugin>
[image: Selection_117.png]
①  Why "include=" and "include:=" are right ,But exclude can only be ":="
②  The plugin display is
"exclude:="*Dao";include="*Service,*Activetor,*Info,ShellTable"" ,But the
"header bundle ID" shows
"exclude:=*Dao;include="*Service,*Activetor,*Info,ShellTable"".
Missing " " symbol.

best regards
duan