You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jochen Wiedmann <jo...@gmail.com> on 2006/01/01 14:25:27 UTC

Optional dependencies

Hi,

are there any recommendations on how to handle dependencies, which 
aren't always required?

For example, I am using JDK 1.5 classes in some projects like 
javax.xml.Constants, or javax.xml.namespace.QName. For JDK 1.3, and JDK 
1.4 users, these are available as dependencies like

     geronimo-qname_1.1_spec

However, I wouldn't like to add these dependencies by default. Is it 
possibly to enable these only, if required?


Regards,

Jochen


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


Re: Optional dependencies

Posted by Jochen Wiedmann <jo...@gmail.com>.
Brett Porter wrote:

> Create a profile, activated by the jdk, and include the dependency within it.

Thanks, read through the docs and this seems to be fine. I was missing 
one feature, though, which I have filed as MNG-1910: The jdk element 
should allow values like 1.4+.

Jochen

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


Re: Optional dependencies

Posted by Brett Porter <br...@gmail.com>.
Create a profile, activated by the jdk, and include the dependency within it.

Cheers,
Brett

On 1/2/06, Jochen Wiedmann <jo...@gmail.com> wrote:
>
> Hi,
>
> are there any recommendations on how to handle dependencies, which
> aren't always required?
>
> For example, I am using JDK 1.5 classes in some projects like
> javax.xml.Constants, or javax.xml.namespace.QName. For JDK 1.3, and JDK
> 1.4 users, these are available as dependencies like
>
>      geronimo-qname_1.1_spec
>
> However, I wouldn't like to add these dependencies by default. Is it
> possibly to enable these only, if required?
>
>
> Regards,
>
> Jochen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Optional dependencies

Posted by Brett Porter <br...@gmail.com>.
Optional was not the solution to his original mail (I emailed him
separately about using profiles in this instance).

I just wanted to answer your question about the use of optional.

- Brett

On 1/2/06, ir. ing. Jan Dockx <ja...@mac.com> wrote:
> Ok,  but in the original mail, Jochen talks about the requirements of
> his _users_, not of the developers of the main project. And users of
> his users need those dependencies transitively …
>
>
> On 1 Jan 2006, at 23:48, Brett Porter wrote:
>
> > The optional tag is *only* for the purposes of transitive
> > dependencies. It's not really intended for use in a real Maven build.
> >
> > - Brett
> >
> > On 1/2/06, ir. ing. Jan Dockx <ja...@mac.com> wrote:
> >> Frankly, I have no idea ;-). I knew the tag existed, but have no
> >> experience with it yet, although I do recognize your problem (see
> >> http://cvs.peopleware.be/training/maven/maven2/dependencies.html,
> >> Issues). I briefly talked with Vincent Massol during JavaPolis (hi
> >> Vincent -- nice chat), and he wasn't aware of this tag either.
> >> Furthermore, I can't find any real documentation on this tag. It seems
> >> like "somebody" saw the issue, added the tag, and left it there? I
> >> hoped you would report back with some experience though ;-).
> >>
> >> What is particularly puzzling to me, is how the <optional /> tag
> >> interacts with the dependency scopes.
> >>
> >>
> >> On 1 Jan 2006, at 20:39, Jochen Wiedmann wrote:
> >>
> >>> ir. ing. Jan Dockx wrote:
> >>>
> >>>> Have you tried the <optional /> tag for the dependency?
> >>>
> >>> Thank you. To be honest, I wasn't aware of this tag.
> >>>
> >>> Reading through the docs, I do, however, believe, that it is a
> >>> partial
> >>> solution only, isn't it? I'd prefer a solution where Maven
> >>> automatically detects the presence or absence of some classes and
> >>> performs the required steps.
> >>>
> >>>
> >>> Jochen
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >> Met vriendelijke groeten,
> >>
> >> Jan Dockx
> >>
> >> PeopleWare NV - Head Office
> >> Cdt.Weynsstraat 85
> >> B-2660 Hoboken
> >> Tel: +32 3 448.33.38
> >> Fax: +32 3 448.32.66
> >>
> >> PeopleWare NV - Branch Office Geel
> >> Kleinhoefstraat 5
> >> B-2440 Geel
> >> Tel: +32 14 57.00.90
> >> Fax: +32 14 58.13.25
> >>
> >> http://www.peopleware.be/
> >> http://www.mobileware.be/
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
>
>

Re: Optional dependencies

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
Ok,  but in the original mail, Jochen talks about the requirements of 
his _users_, not of the developers of the main project. And users of 
his users need those dependencies transitively …


On 1 Jan 2006, at 23:48, Brett Porter wrote:

> The optional tag is *only* for the purposes of transitive
> dependencies. It's not really intended for use in a real Maven build.
>
> - Brett
>
> On 1/2/06, ir. ing. Jan Dockx <ja...@mac.com> wrote:
>> Frankly, I have no idea ;-). I knew the tag existed, but have no
>> experience with it yet, although I do recognize your problem (see
>> http://cvs.peopleware.be/training/maven/maven2/dependencies.html,
>> Issues). I briefly talked with Vincent Massol during JavaPolis (hi
>> Vincent -- nice chat), and he wasn't aware of this tag either.
>> Furthermore, I can't find any real documentation on this tag. It seems
>> like "somebody" saw the issue, added the tag, and left it there? I
>> hoped you would report back with some experience though ;-).
>>
>> What is particularly puzzling to me, is how the <optional /> tag
>> interacts with the dependency scopes.
>>
>>
>> On 1 Jan 2006, at 20:39, Jochen Wiedmann wrote:
>>
>>> ir. ing. Jan Dockx wrote:
>>>
>>>> Have you tried the <optional /> tag for the dependency?
>>>
>>> Thank you. To be honest, I wasn't aware of this tag.
>>>
>>> Reading through the docs, I do, however, believe, that it is a 
>>> partial
>>> solution only, isn't it? I'd prefer a solution where Maven
>>> automatically detects the presence or absence of some classes and
>>> performs the required steps.
>>>
>>>
>>> Jochen
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>> Met vriendelijke groeten,
>>
>> Jan Dockx
>>
>> PeopleWare NV - Head Office
>> Cdt.Weynsstraat 85
>> B-2660 Hoboken
>> Tel: +32 3 448.33.38
>> Fax: +32 3 448.32.66
>>
>> PeopleWare NV - Branch Office Geel
>> Kleinhoefstraat 5
>> B-2440 Geel
>> Tel: +32 14 57.00.90
>> Fax: +32 14 58.13.25
>>
>> http://www.peopleware.be/
>> http://www.mobileware.be/
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: Optional dependencies

Posted by Brett Porter <br...@gmail.com>.
The optional tag is *only* for the purposes of transitive
dependencies. It's not really intended for use in a real Maven build.

- Brett

On 1/2/06, ir. ing. Jan Dockx <ja...@mac.com> wrote:
> Frankly, I have no idea ;-). I knew the tag existed, but have no
> experience with it yet, although I do recognize your problem (see
> http://cvs.peopleware.be/training/maven/maven2/dependencies.html,
> Issues). I briefly talked with Vincent Massol during JavaPolis (hi
> Vincent -- nice chat), and he wasn't aware of this tag either.
> Furthermore, I can't find any real documentation on this tag. It seems
> like "somebody" saw the issue, added the tag, and left it there? I
> hoped you would report back with some experience though ;-).
>
> What is particularly puzzling to me, is how the <optional /> tag
> interacts with the dependency scopes.
>
>
> On 1 Jan 2006, at 20:39, Jochen Wiedmann wrote:
>
> > ir. ing. Jan Dockx wrote:
> >
> >> Have you tried the <optional /> tag for the dependency?
> >
> > Thank you. To be honest, I wasn't aware of this tag.
> >
> > Reading through the docs, I do, however, believe, that it is a partial
> > solution only, isn't it? I'd prefer a solution where Maven
> > automatically detects the presence or absence of some classes and
> > performs the required steps.
> >
> >
> > Jochen
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
>
>

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


Re: Optional dependencies

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
Frankly, I have no idea ;-). I knew the tag existed, but have no 
experience with it yet, although I do recognize your problem (see 
http://cvs.peopleware.be/training/maven/maven2/dependencies.html, 
Issues). I briefly talked with Vincent Massol during JavaPolis (hi 
Vincent -- nice chat), and he wasn't aware of this tag either. 
Furthermore, I can't find any real documentation on this tag. It seems 
like "somebody" saw the issue, added the tag, and left it there? I 
hoped you would report back with some experience though ;-).

What is particularly puzzling to me, is how the <optional /> tag 
interacts with the dependency scopes.


On 1 Jan 2006, at 20:39, Jochen Wiedmann wrote:

> ir. ing. Jan Dockx wrote:
>
>> Have you tried the <optional /> tag for the dependency?
>
> Thank you. To be honest, I wasn't aware of this tag.
>
> Reading through the docs, I do, however, believe, that it is a partial 
> solution only, isn't it? I'd prefer a solution where Maven 
> automatically detects the presence or absence of some classes and 
> performs the required steps.
>
>
> Jochen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: Optional dependencies

Posted by Jochen Wiedmann <jo...@gmail.com>.
ir. ing. Jan Dockx wrote:

> Have you tried the <optional /> tag for the dependency?

Thank you. To be honest, I wasn't aware of this tag.

Reading through the docs, I do, however, believe, that it is a partial 
solution only, isn't it? I'd prefer a solution where Maven automatically 
detects the presence or absence of some classes and performs the 
required steps.


Jochen

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


Re: Optional dependencies

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
Have you tried the <optional /> tag for the dependency?


On 1 Jan 2006, at 14:25, Jochen Wiedmann wrote:

>
> Hi,
>
> are there any recommendations on how to handle dependencies, which 
> aren't always required?
>
> For example, I am using JDK 1.5 classes in some projects like 
> javax.xml.Constants, or javax.xml.namespace.QName. For JDK 1.3, and 
> JDK 1.4 users, these are available as dependencies like
>
>     geronimo-qname_1.1_spec
>
> However, I wouldn't like to add these dependencies by default. Is it 
> possibly to enable these only, if required?
>
>
> Regards,
>
> Jochen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/