Activate differernt profiles in Multimodule projects

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Activate differernt profiles in Multimodule projects

MartyMcFly
Hi,

I have a multimodule project in which some modules need an additional sourcefolder, whereas other modules dont.
To avoid redefining this in each of the relevant modules I want to add this to the parent pom and activate the project if this folder X is present.

Unfortunately this seems not working as the activation section seems to be interpreted during the parent pom, where no folder X exists. Ergo the profile is deactivated and the relevant modules are failing.

How can I activate profiles, defined in the parent pom,  for some modules ?

Is there another way which avoids redefining this in every module ?

Thanks

PS: Using maven 2.2.1
Reply | Threaded
Open this post in threaded view
|

Re: Activate differernt profiles in Multimodule projects

stephenconnolly
On 4 June 2010 09:18, MartyMcFly <[hidden email]> wrote:

>
> Hi,
>
> I have a multimodule project in which some modules need an additional
> sourcefolder, whereas other modules dont.
> To avoid redefining this in each of the relevant modules I want to add this
> to the parent pom and activate the project if this folder X is present.
>
> Unfortunately this seems not working as the activation section seems to be
> interpreted during the parent pom, where no folder X exists. Ergo the
> profile is deactivated and the relevant modules are failing.
>
> How can I activate profiles, defined in the parent pom,  for some modules ?
>
> Is there another way which avoids redefining this in every module ?
>

don't go against the maven way... apart from generated source code, you
should only have one source folder per module... and if you are generating
source code, best practice is to keep that in its own module (but obviously
generate the source code into target/generated-source/plugin-name/..... and
have the plugin add the generated directory as a source root... only as a
last resource should you use build-helper)


>
> Thanks
>
> PS: Using maven 2.2.1
> --
> View this message in context:
> http://old.nabble.com/Activate-differernt-profiles-in-Multimodule-projects-tp28776973p28776973.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Activate differernt profiles in Multimodule projects

MartyMcFly
thanks for the answer.

Sorry I probably should have add more information.

It is generated source code. We have IDL files for Corba which are in project folder 'idl' - but not all modules have this idl folder.

The idea is: in case of a 'idl' folder, the system to generate the java files from idl files is running and the /target/generated-sources (in which the java files are generated) is added as source folder.

if no idl folder is given, the "normal" way to should proceed.

But the problem remains that this system for the idls should only be active when this idl folder is present - is this possible to define in the parent pom ? (especially as the idl2java system requires addtional dependencies etc - I dont want to redefine that in every pom of a module which requires it).

As we are bound to visibroker and there is no maven plugin available, we are required to find another solution :(

Stephen Connolly-2 wrote
On 4 June 2010 09:18, MartyMcFly <martymcfly@smart-mail.de> wrote:

>
> Hi,
>
> I have a multimodule project in which some modules need an additional
> sourcefolder, whereas other modules dont.
> To avoid redefining this in each of the relevant modules I want to add this
> to the parent pom and activate the project if this folder X is present.
>
> Unfortunately this seems not working as the activation section seems to be
> interpreted during the parent pom, where no folder X exists. Ergo the
> profile is deactivated and the relevant modules are failing.
>
> How can I activate profiles, defined in the parent pom,  for some modules ?
>
> Is there another way which avoids redefining this in every module ?
>

don't go against the maven way... apart from generated source code, you
should only have one source folder per module... and if you are generating
source code, best practice is to keep that in its own module (but obviously
generate the source code into target/generated-source/plugin-name/..... and
have the plugin add the generated directory as a source root... only as a
last resource should you use build-helper)


>
> Thanks
>
> PS: Using maven 2.2.1
> --
> View this message in context:
> http://old.nabble.com/Activate-differernt-profiles-in-Multimodule-projects-tp28776973p28776973.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Activate differernt profiles in Multimodule projects

Tim Kettler
Hi,

wouldn't adding a specialized parent pom for modules containing idl
files to your project work?

-Tim

On 04.06.2010 10:33, MartyMcFly wrote:

>
> thanks for the answer.
>
> Sorry I probably should have add more information.
>
> It is generated source code. We have IDL files for Corba which are in
> project folder 'idl' - but not all modules have this idl folder.
>
> The idea is: in case of a 'idl' folder, the system to generate the java
> files from idl files is running and the /target/generated-sources (in which
> the java files are generated) is added as source folder.
>
> if no idl folder is given, the "normal" way to should proceed.
>
> But the problem remains that this system for the idls should only be active
> when this idl folder is present - is this possible to define in the parent
> pom ? (especially as the idl2java system requires addtional dependencies etc
> - I dont want to redefine that in every pom of a module which requires it).
>
> As we are bound to visibroker and there is no maven plugin available, we are
> required to find another solution :(
>
>
> Stephen Connolly-2 wrote:
>>
>> On 4 June 2010 09:18, MartyMcFly<[hidden email]>  wrote:
>>
>>>
>>> Hi,
>>>
>>> I have a multimodule project in which some modules need an additional
>>> sourcefolder, whereas other modules dont.
>>> To avoid redefining this in each of the relevant modules I want to add
>>> this
>>> to the parent pom and activate the project if this folder X is present.
>>>
>>> Unfortunately this seems not working as the activation section seems to
>>> be
>>> interpreted during the parent pom, where no folder X exists. Ergo the
>>> profile is deactivated and the relevant modules are failing.
>>>
>>> How can I activate profiles, defined in the parent pom,  for some modules
>>> ?
>>>
>>> Is there another way which avoids redefining this in every module ?
>>>
>>
>> don't go against the maven way... apart from generated source code, you
>> should only have one source folder per module... and if you are generating
>> source code, best practice is to keep that in its own module (but
>> obviously
>> generate the source code into target/generated-source/plugin-name/.....
>> and
>> have the plugin add the generated directory as a source root... only as a
>> last resource should you use build-helper)
>>
>>
>>>
>>> Thanks
>>>
>>> PS: Using maven 2.2.1
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Activate-differernt-profiles-in-Multimodule-projects-tp28776973p28776973.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Activate differernt profiles in Multimodule projects

stephenconnolly
In reply to this post by MartyMcFly
write your own maven plugin

it's not that hard

it would just check if the idk folder is present and then generate the
source code and attach the generated source code to the current module.

then just add the maven plugin to your pom and away you go

On 4 June 2010 09:33, MartyMcFly <[hidden email]> wrote:

>
> thanks for the answer.
>
> Sorry I probably should have add more information.
>
> It is generated source code. We have IDL files for Corba which are in
> project folder 'idl' - but not all modules have this idl folder.
>
> The idea is: in case of a 'idl' folder, the system to generate the java
> files from idl files is running and the /target/generated-sources (in which
> the java files are generated) is added as source folder.
>
> if no idl folder is given, the "normal" way to should proceed.
>
> But the problem remains that this system for the idls should only be active
> when this idl folder is present - is this possible to define in the parent
> pom ? (especially as the idl2java system requires addtional dependencies
> etc
> - I dont want to redefine that in every pom of a module which requires it).
>
> As we are bound to visibroker and there is no maven plugin available, we
> are
> required to find another solution :(
>
>
> Stephen Connolly-2 wrote:
> >
> > On 4 June 2010 09:18, MartyMcFly <[hidden email]> wrote:
> >
> >>
> >> Hi,
> >>
> >> I have a multimodule project in which some modules need an additional
> >> sourcefolder, whereas other modules dont.
> >> To avoid redefining this in each of the relevant modules I want to add
> >> this
> >> to the parent pom and activate the project if this folder X is present.
> >>
> >> Unfortunately this seems not working as the activation section seems to
> >> be
> >> interpreted during the parent pom, where no folder X exists. Ergo the
> >> profile is deactivated and the relevant modules are failing.
> >>
> >> How can I activate profiles, defined in the parent pom,  for some
> modules
> >> ?
> >>
> >> Is there another way which avoids redefining this in every module ?
> >>
> >
> > don't go against the maven way... apart from generated source code, you
> > should only have one source folder per module... and if you are
> generating
> > source code, best practice is to keep that in its own module (but
> > obviously
> > generate the source code into target/generated-source/plugin-name/.....
> > and
> > have the plugin add the generated directory as a source root... only as a
> > last resource should you use build-helper)
> >
> >
> >>
> >> Thanks
> >>
> >> PS: Using maven 2.2.1
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Activate-differernt-profiles-in-Multimodule-projects-tp28776973p28776973.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Activate-differernt-profiles-in-Multimodule-projects-tp28776973p28777178.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Activate differernt profiles in Multimodule projects

MartyMcFly
In reply to this post by Tim Kettler
This is actually a nice idea...

thanks - going for this


Tim Kettler wrote
Hi,

wouldn't adding a specialized parent pom for modules containing idl
files to your project work?

-Tim

On 04.06.2010 10:33, MartyMcFly wrote:
>
> thanks for the answer.
>
> Sorry I probably should have add more information.
>
> It is generated source code. We have IDL files for Corba which are in
> project folder 'idl' - but not all modules have this idl folder.
>
> The idea is: in case of a 'idl' folder, the system to generate the java
> files from idl files is running and the /target/generated-sources (in which
> the java files are generated) is added as source folder.
>
> if no idl folder is given, the "normal" way to should proceed.
>
> But the problem remains that this system for the idls should only be active
> when this idl folder is present - is this possible to define in the parent
> pom ? (especially as the idl2java system requires addtional dependencies etc
> - I dont want to redefine that in every pom of a module which requires it).
>
> As we are bound to visibroker and there is no maven plugin available, we are
> required to find another solution :(
>
>
> Stephen Connolly-2 wrote:
>>
>> On 4 June 2010 09:18, MartyMcFly<martymcfly@smart-mail.de>  wrote:
>>
>>>
>>> Hi,
>>>
>>> I have a multimodule project in which some modules need an additional
>>> sourcefolder, whereas other modules dont.
>>> To avoid redefining this in each of the relevant modules I want to add
>>> this
>>> to the parent pom and activate the project if this folder X is present.
>>>
>>> Unfortunately this seems not working as the activation section seems to
>>> be
>>> interpreted during the parent pom, where no folder X exists. Ergo the
>>> profile is deactivated and the relevant modules are failing.
>>>
>>> How can I activate profiles, defined in the parent pom,  for some modules
>>> ?
>>>
>>> Is there another way which avoids redefining this in every module ?
>>>
>>
>> don't go against the maven way... apart from generated source code, you
>> should only have one source folder per module... and if you are generating
>> source code, best practice is to keep that in its own module (but
>> obviously
>> generate the source code into target/generated-source/plugin-name/.....
>> and
>> have the plugin add the generated directory as a source root... only as a
>> last resource should you use build-helper)
>>
>>
>>>
>>> Thanks
>>>
>>> PS: Using maven 2.2.1
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Activate-differernt-profiles-in-Multimodule-projects-tp28776973p28776973.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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