You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Richard van Nieuwenhoven <ni...@cfc.at> on 2008/04/24 09:33:26 UTC

a way to extend the dependencies at build time

Hi,

i have a strange requirement, i need a possibility to extend the
dependencies of a MavenProject in a plugin or component during build
time. I tried adding dependencies in a validation phase plugin, with no
success.

Is there a "official" way to do this? Maybe a dynamic profile? Defaults
injector?

(The built stability is guarantied because the plugin or component will
produce alway the same dependencies for a project configuration).

thanks for any ideas!
Ritchie

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


Re: a way to extend the dependencies at build time

Posted by Milos Kleint <mk...@gmail.com>.
oh well. you assume the IDE integration is and shall be running the
build. I try to avoid that for performance reasons in netbeans
integration.

Milos

On Thu, Apr 24, 2008 at 12:24 PM, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
> Hi,
>
>  the reason i need it is that a plugin generates code that depends on a
>  framework in a specific configuration. And the knowledge witch
>  combination of frameworks is needed, is provided by the generator (the
>  plugin). I do not like to duplicate this knowledge in evey module that
>  uses the plugin, this is why i would like the plugin (or some other
>  mean) to include the dependencies in the ProjectModel.
>
>  The IDE integration should be no problem because the included
>  dependencies would (and must) be included in the ProjectModel and
>  therefore are propagated to all running plugins as if they were in the
>  pom directly.
>
>  mfg
>  Ritchie
>
>
>
>  Milos Kleint wrote:
>  > I discourage any dynamic tweaking of the project. Among other things
>  > is breaks IDE integration. appfuse' warpath plugin does this sort of
>  > thing somehow. I would say it's a hack however and might not work in
>  > future versions..
>  >
>  > Milos
>  >
>  > On Thu, Apr 24, 2008 at 9:33 AM, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
>  >> Hi,
>  >>
>  >>  i have a strange requirement, i need a possibility to extend the
>  >>  dependencies of a MavenProject in a plugin or component during build
>  >>  time. I tried adding dependencies in a validation phase plugin, with no
>  >>  success.
>  >>
>  >>  Is there a "official" way to do this? Maybe a dynamic profile? Defaults
>  >>  injector?
>  >>
>  >>  (The built stability is guarantied because the plugin or component will
>  >>  produce alway the same dependencies for a project configuration).
>  >>
>  >>  thanks for any ideas!
>  >>  Ritchie
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>  >>  For additional commands, e-mail: dev-help@maven.apache.org
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>  > For additional commands, e-mail: dev-help@maven.apache.org
>  >
>  >
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>  For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: a way to extend the dependencies at build time

Posted by Ralph Goers <Ra...@dslextreme.com>.
I did this with Maven 1 and I'm sure it would work with Maven 2, but it 
may not be what your want. The way I handled it was to dynamically 
construct the pom in a target directory along with the project files and 
then invoke the goal (plugin) calls Maven again just for that project.

Richard van Nieuwenhoven wrote:
> Hi,
>
> That is why i ask for an "official" solution, a plugin will probably not
> work. But is there an other? like a custom "dependence resolution
> component" for this project. Or a global custom "dependence resolution
> component". Or a way to dynamically create a global or local profile.
>
> Or ...... any ideas?
>
> thanks for the help,
> Ritchie
>
> Gilles Scokart wrote:
>   
>> On 24/04/2008, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
>>     
>>> Hi,
>>>
>>>  the reason i need it is that a plugin generates code that depends on a
>>>  framework in a specific configuration. And the knowledge witch
>>>  combination of frameworks is needed, is provided by the generator (the
>>>  plugin). I do not like to duplicate this knowledge in evey module that
>>>  uses the plugin, this is why i would like the plugin (or some other
>>>  mean) to include the dependencies in the ProjectModel.
>>>
>>>  The IDE integration should be no problem because the included
>>>  dependencies would (and must) be included in the ProjectModel and
>>>  therefore are propagated to all running plugins as if they were in the
>>>  pom directly.
>>>
>>>  mfg
>>>  Ritchie
>>>
>>>       
>> Only if the plugin is executed.  IDE (or other tools like Ivy for
>> instance) don't run the plugins to use the dependency informations.
>>
>> Also think to what you will publish to a repository.  The projects
>> that depends on the project using the plugin will not execute your
>> plugin neither.
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>   

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


RE: a way to extend the dependencies at build time

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Have you looked at the new import scope feature?

-----Original Message-----
From: Richard van Nieuwenhoven [mailto:nir@cfc.at] 
Sent: Thursday, April 24, 2008 6:47 AM
To: Maven Developers List
Subject: Re: a way to extend the dependencies at build time

Hi,

That is why i ask for an "official" solution, a plugin will probably not
work. But is there an other? like a custom "dependence resolution
component" for this project. Or a global custom "dependence resolution
component". Or a way to dynamically create a global or local profile.

Or ...... any ideas?

thanks for the help,
Ritchie

Gilles Scokart wrote:
> On 24/04/2008, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
>> Hi,
>>
>>  the reason i need it is that a plugin generates code that depends on
a
>>  framework in a specific configuration. And the knowledge witch
>>  combination of frameworks is needed, is provided by the generator
(the
>>  plugin). I do not like to duplicate this knowledge in evey module
that
>>  uses the plugin, this is why i would like the plugin (or some other
>>  mean) to include the dependencies in the ProjectModel.
>>
>>  The IDE integration should be no problem because the included
>>  dependencies would (and must) be included in the ProjectModel and
>>  therefore are propagated to all running plugins as if they were in
the
>>  pom directly.
>>
>>  mfg
>>  Ritchie
>>
> Only if the plugin is executed.  IDE (or other tools like Ivy for
> instance) don't run the plugins to use the dependency informations.
> 
> Also think to what you will publish to a repository.  The projects
> that depends on the project using the plugin will not execute your
> plugin neither.
> 


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


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


Re: a way to extend the dependencies at build time

Posted by Richard van Nieuwenhoven <ni...@cfc.at>.
Hi,

That is why i ask for an "official" solution, a plugin will probably not
work. But is there an other? like a custom "dependence resolution
component" for this project. Or a global custom "dependence resolution
component". Or a way to dynamically create a global or local profile.

Or ...... any ideas?

thanks for the help,
Ritchie

Gilles Scokart wrote:
> On 24/04/2008, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
>> Hi,
>>
>>  the reason i need it is that a plugin generates code that depends on a
>>  framework in a specific configuration. And the knowledge witch
>>  combination of frameworks is needed, is provided by the generator (the
>>  plugin). I do not like to duplicate this knowledge in evey module that
>>  uses the plugin, this is why i would like the plugin (or some other
>>  mean) to include the dependencies in the ProjectModel.
>>
>>  The IDE integration should be no problem because the included
>>  dependencies would (and must) be included in the ProjectModel and
>>  therefore are propagated to all running plugins as if they were in the
>>  pom directly.
>>
>>  mfg
>>  Ritchie
>>
> Only if the plugin is executed.  IDE (or other tools like Ivy for
> instance) don't run the plugins to use the dependency informations.
> 
> Also think to what you will publish to a repository.  The projects
> that depends on the project using the plugin will not execute your
> plugin neither.
> 


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


Re: a way to extend the dependencies at build time

Posted by Gilles Scokart <gs...@gmail.com>.
On 24/04/2008, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
> Hi,
>
>  the reason i need it is that a plugin generates code that depends on a
>  framework in a specific configuration. And the knowledge witch
>  combination of frameworks is needed, is provided by the generator (the
>  plugin). I do not like to duplicate this knowledge in evey module that
>  uses the plugin, this is why i would like the plugin (or some other
>  mean) to include the dependencies in the ProjectModel.
>
>  The IDE integration should be no problem because the included
>  dependencies would (and must) be included in the ProjectModel and
>  therefore are propagated to all running plugins as if they were in the
>  pom directly.
>
>  mfg
>  Ritchie
>
Only if the plugin is executed.  IDE (or other tools like Ivy for
instance) don't run the plugins to use the dependency informations.

Also think to what you will publish to a repository.  The projects
that depends on the project using the plugin will not execute your
plugin neither.

-- 
Gilles Scokart

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


Re: a way to extend the dependencies at build time

Posted by Richard van Nieuwenhoven <ni...@cfc.at>.
Hi,

the reason i need it is that a plugin generates code that depends on a
framework in a specific configuration. And the knowledge witch
combination of frameworks is needed, is provided by the generator (the
plugin). I do not like to duplicate this knowledge in evey module that
uses the plugin, this is why i would like the plugin (or some other
mean) to include the dependencies in the ProjectModel.

The IDE integration should be no problem because the included
dependencies would (and must) be included in the ProjectModel and
therefore are propagated to all running plugins as if they were in the
pom directly.

mfg
Ritchie

Milos Kleint wrote:
> I discourage any dynamic tweaking of the project. Among other things
> is breaks IDE integration. appfuse' warpath plugin does this sort of
> thing somehow. I would say it's a hack however and might not work in
> future versions..
> 
> Milos
> 
> On Thu, Apr 24, 2008 at 9:33 AM, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
>> Hi,
>>
>>  i have a strange requirement, i need a possibility to extend the
>>  dependencies of a MavenProject in a plugin or component during build
>>  time. I tried adding dependencies in a validation phase plugin, with no
>>  success.
>>
>>  Is there a "official" way to do this? Maybe a dynamic profile? Defaults
>>  injector?
>>
>>  (The built stability is guarantied because the plugin or component will
>>  produce alway the same dependencies for a project configuration).
>>
>>  thanks for any ideas!
>>  Ritchie
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>  For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 


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


Re: a way to extend the dependencies at build time

Posted by Milos Kleint <mk...@gmail.com>.
I discourage any dynamic tweaking of the project. Among other things
is breaks IDE integration. appfuse' warpath plugin does this sort of
thing somehow. I would say it's a hack however and might not work in
future versions..

Milos

On Thu, Apr 24, 2008 at 9:33 AM, Richard van Nieuwenhoven <ni...@cfc.at> wrote:
> Hi,
>
>  i have a strange requirement, i need a possibility to extend the
>  dependencies of a MavenProject in a plugin or component during build
>  time. I tried adding dependencies in a validation phase plugin, with no
>  success.
>
>  Is there a "official" way to do this? Maybe a dynamic profile? Defaults
>  injector?
>
>  (The built stability is guarantied because the plugin or component will
>  produce alway the same dependencies for a project configuration).
>
>  thanks for any ideas!
>  Ritchie
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>  For additional commands, e-mail: dev-help@maven.apache.org
>
>

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