You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "niibasta@gmail.com" <ni...@gmail.com> on 2010/09/16 09:10:30 UTC
Problem with embedded oprional dependencies
Hello!
I have a problem with with libraries, when i'm trying to embed them into
my bundle using <Embed-Dependency> instruction.
For example, I have a module A, which has dependency:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>1.7.0</version>
</dependency>
It's not a bundle, so I'm trying to include it into my bundle "A":
<Embed-Dependency>*;optional=false;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>libs</Embed-Directory>
If we look at groovy's pom, we'll see many dependencies, most of all
have flag optional=true. One of these dependencies:
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>bsf</groupId>
<artifactId>bsf</artifactId>
<version>2.4.0</version>
<scope>compile</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
When I generate a pom for my module I get "Import-Package" directive,
which contains all packages from my bundle and included libraries, for
example:
...org.apache.tools.ant.taskdefs,org.apache.tools.ant.types,org.apache.tools.ant.util,org.apache.bsf,org.apache.bsf.util...
and there is no resolution:="optional" or something like that.
I put a flag "optional=false", however, it has no effect to transitive
dependencies.
1. Is there any way to include simple library (not bundle) into my
bundle without excluding all transitive packages from my "import"?
2. Can bundle plugin set resolution:="optional" for those transitive
dependencies, which are oprional in pom?
3. Maybe, I must use only wrapped libraries in dependencies, which
already bundles? I don't want to deploy groovy like a bundle, because
it's unnecessary to share it for all bundles, because it used only in
one bundle.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Problem with embedded oprional dependencies
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
In Sling we use
<bundle>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.7.4</version>
</bundle>
which is a real bundle enclosing the really required dependencies of groovy.
Regards
Felix
Am 16.09.2010 09:10, schrieb niibasta@gmail.com:
> Hello!
>
> I have a problem with with libraries, when i'm trying to embed them into
> my bundle using <Embed-Dependency> instruction.
> For example, I have a module A, which has dependency:
>
> <dependency>
> <groupId>org.codehaus.groovy</groupId>
> <artifactId>groovy</artifactId>
> <version>1.7.0</version>
> </dependency>
>
> It's not a bundle, so I'm trying to include it into my bundle "A":
>
> <Embed-Dependency>*;optional=false;scope=compile|runtime</Embed-Dependency>
> <Embed-Transitive>true</Embed-Transitive>
> <Embed-Directory>libs</Embed-Directory>
>
> If we look at groovy's pom, we'll see many dependencies, most of all
> have flag optional=true. One of these dependencies:
> <dependency>
> <groupId>org.apache.ant</groupId>
> <artifactId>ant</artifactId>
> <version>1.7.1</version>
> <scope>compile</scope>
> <optional>true</optional>
> </dependency>
>
> <dependency>
> <groupId>bsf</groupId>
> <artifactId>bsf</artifactId>
> <version>2.4.0</version>
> <scope>compile</scope>
> <optional>true</optional>
> <exclusions>
> <exclusion>
> <groupId>commons-logging</groupId>
> <artifactId>commons-logging</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
>
> When I generate a pom for my module I get "Import-Package" directive,
> which contains all packages from my bundle and included libraries, for
> example:
>
> ...org.apache.tools.ant.taskdefs,org.apache.tools.ant.types,org.apache.tools.ant.util,org.apache.bsf,org.apache.bsf.util...
>
>
> and there is no resolution:="optional" or something like that.
>
> I put a flag "optional=false", however, it has no effect to transitive
> dependencies.
>
> 1. Is there any way to include simple library (not bundle) into my
> bundle without excluding all transitive packages from my "import"?
>
> 2. Can bundle plugin set resolution:="optional" for those transitive
> dependencies, which are oprional in pom?
>
> 3. Maybe, I must use only wrapped libraries in dependencies, which
> already bundles? I don't want to deploy groovy like a bundle, because
> it's unnecessary to share it for all bundles, because it used only in
> one bundle.
>
>
>
> ---------------------------------------------------------------------
> 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: Startlevel for bundles in felix.auto.deploy.dir
Posted by Tobias Wunden <to...@id.ethz.ch>.
Thanks for your reply, Richard. I opened FELIX-2678 to track this issue.
Tobias
On 30.10.2010, at 20:27, Richard S. Hall wrote:
> On 10/30/10 6:23, Wunden Tobias wrote:
>> Hi,
>>
>> is there a way to specify what the start level is for bundles that are found in the auto deploy directory as specified by "felix.auto.deploy.dir" in the felix configuration?
>>
>> The reason I'm asking is that by default, the shell bundles are in there, and it would be great to have the shell loaded when all the applications have been deployed, which are currently loaded using the "felix.auto.start.<level>" directive in config.properties, and it would be great to be able to specify the<level> for the bundles found in "felix.auto.deploy.dir" as well (i.e. loading them last). Is there a way to to this? It doesn't seem so from the documentation.
>>
>> Thank you for pointers and hints,
>
> I think if you specify felix.startlevel.bundle, which is the initial start level for bundles, then it will put all newly installed bundles into that start level. However, this isn't specific to the auto deploy directory, it will impact all bundles installed.
>
> I don't think there is any issue with introducing a felix.auto.deploy.startlevel property. Feel free to open a JIRA issue to request such a feature.
>
> -> richard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Startlevel for bundles in felix.auto.deploy.dir
Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 10/30/10 6:23, Wunden Tobias wrote:
> Hi,
>
> is there a way to specify what the start level is for bundles that are found in the auto deploy directory as specified by "felix.auto.deploy.dir" in the felix configuration?
>
> The reason I'm asking is that by default, the shell bundles are in there, and it would be great to have the shell loaded when all the applications have been deployed, which are currently loaded using the "felix.auto.start.<level>" directive in config.properties, and it would be great to be able to specify the<level> for the bundles found in "felix.auto.deploy.dir" as well (i.e. loading them last). Is there a way to to this? It doesn't seem so from the documentation.
>
> Thank you for pointers and hints,
I think if you specify felix.startlevel.bundle, which is the initial
start level for bundles, then it will put all newly installed bundles
into that start level. However, this isn't specific to the auto deploy
directory, it will impact all bundles installed.
I don't think there is any issue with introducing a
felix.auto.deploy.startlevel property. Feel free to open a JIRA issue to
request such a feature.
-> richard
> Tobias
> ---------------------------------------------------------------------
> 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
Startlevel for bundles in felix.auto.deploy.dir
Posted by Wunden Tobias <to...@id.ethz.ch>.
Hi,
is there a way to specify what the start level is for bundles that are found in the auto deploy directory as specified by "felix.auto.deploy.dir" in the felix configuration?
The reason I'm asking is that by default, the shell bundles are in there, and it would be great to have the shell loaded when all the applications have been deployed, which are currently loaded using the "felix.auto.start.<level>" directive in config.properties, and it would be great to be able to specify the <level> for the bundles found in "felix.auto.deploy.dir" as well (i.e. loading them last). Is there a way to to this? It doesn't seem so from the documentation.
Thank you for pointers and hints,
Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Problem with embedded oprional dependencies
Posted by hapa li <kh...@gmail.com>.
U can add them again as a maven dependency in your pom :)
On Thu, Sep 16, 2010 at 4:25 PM, niibasta@gmail.com <ni...@gmail.com> wrote:
> Yes, but I need some of them which are not optional
>
> On 16.09.2010 18:18, hapa li wrote:
>>
>> u can exclude the transitive dependencies in your pom.
>>
>> On Thu, Sep 16, 2010 at 2:38 PM, niibasta@gmail.com<ni...@gmail.com>
>> wrote:
>>>
>>> It doesn't matter. Groovy is just an example. I'm trying to tell that if
>>> I'm trying to include library into bundle, all optional transitive
>>> dependencies become mandatory.
>>>
>>> On 16.09.2010 14:38, Rémon. Sinnema wrote:
>>>>>
>>>>> <dependency>
>>>>> <groupId>org.codehaus.groovy</groupId>
>>>>> <artifactId>groovy</artifactId>
>>>>> <version>1.7.0</version>
>>>>> </dependency>
>>>>>
>>>>> It's not a bundle, so I'm trying to include it into my bundle "A":
>>>>
>>>> The version at
>>>> http://dist.groovy.codehaus.org/distributions/groovy-binary-1.7.0.zip
>>>> *is*
>>>> an
>>>> OSGi bundle.
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Problem with embedded oprional dependencies
Posted by "niibasta@gmail.com" <ni...@gmail.com>.
Yes, but I need some of them which are not optional
On 16.09.2010 18:18, hapa li wrote:
> u can exclude the transitive dependencies in your pom.
>
> On Thu, Sep 16, 2010 at 2:38 PM, niibasta@gmail.com<ni...@gmail.com> wrote:
>> It doesn't matter. Groovy is just an example. I'm trying to tell that if
>> I'm trying to include library into bundle, all optional transitive
>> dependencies become mandatory.
>>
>> On 16.09.2010 14:38, Rémon. Sinnema wrote:
>>>> <dependency>
>>>> <groupId>org.codehaus.groovy</groupId>
>>>> <artifactId>groovy</artifactId>
>>>> <version>1.7.0</version>
>>>> </dependency>
>>>>
>>>> It's not a bundle, so I'm trying to include it into my bundle "A":
>>> The version at
>>> http://dist.groovy.codehaus.org/distributions/groovy-binary-1.7.0.zip *is*
>>> an
>>> OSGi bundle.
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
> ---------------------------------------------------------------------
> 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: Problem with embedded oprional dependencies
Posted by hapa li <kh...@gmail.com>.
u can exclude the transitive dependencies in your pom.
On Thu, Sep 16, 2010 at 2:38 PM, niibasta@gmail.com <ni...@gmail.com> wrote:
> It doesn't matter. Groovy is just an example. I'm trying to tell that if
> I'm trying to include library into bundle, all optional transitive
> dependencies become mandatory.
>
> On 16.09.2010 14:38, Rémon. Sinnema wrote:
>>>
>>> <dependency>
>>> <groupId>org.codehaus.groovy</groupId>
>>> <artifactId>groovy</artifactId>
>>> <version>1.7.0</version>
>>> </dependency>
>>>
>>> It's not a bundle, so I'm trying to include it into my bundle "A":
>>
>> The version at
>> http://dist.groovy.codehaus.org/distributions/groovy-binary-1.7.0.zip *is*
>> an
>> OSGi bundle.
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Problem with embedded oprional dependencies
Posted by "niibasta@gmail.com" <ni...@gmail.com>.
It doesn't matter. Groovy is just an example. I'm trying to tell that
if I'm trying to include library into bundle, all optional transitive
dependencies become mandatory.
On 16.09.2010 14:38, Rémon. Sinnema wrote:
>> <dependency>
>> <groupId>org.codehaus.groovy</groupId>
>> <artifactId>groovy</artifactId>
>> <version>1.7.0</version>
>> </dependency>
>>
>> It's not a bundle, so I'm trying to include it into my bundle "A":
> The version at
> http://dist.groovy.codehaus.org/distributions/groovy-binary-1.7.0.zip *is* an
> OSGi bundle.
>
>
>
>
> ---------------------------------------------------------------------
> 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: Problem with embedded oprional dependencies
Posted by "Rémon. Sinnema" <rs...@yahoo.com>.
> <dependency>
> <groupId>org.codehaus.groovy</groupId>
> <artifactId>groovy</artifactId>
> <version>1.7.0</version>
> </dependency>
>
> It's not a bundle, so I'm trying to include it into my bundle "A":
The version at
http://dist.groovy.codehaus.org/distributions/groovy-binary-1.7.0.zip *is* an
OSGi bundle.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org