You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by K J <go...@gmail.com> on 2009/12/02 21:19:19 UTC

What is the 'Maven way' to handle multi-artifact code generation from a single model source?

Does anyone have any examples or tips about how to handle the
generation of multiple artifacts based on a shared model? For example,
I have a project which needs to produce both Java and ActionScript
code based on a shared UML model. I'm having trouble figuring out how
to best setup and manage these types of projects, so that a change to
the source project can easily result in the build of all the various
generated outputs.  Thanks in advance for the help.

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


Re: What is the 'Maven way' to handle multi-artifact code generation from a single model source?

Posted by Kalle Korhonen <ka...@gmail.com>.
Since the build artifacts are output of the same source, they should
part of the same module. Use classifiers to specify the different
artifacts. If you are using custom scripts to produce the output (i.e.
not plugins that attach additional artifacts automatically), use
buildhelper plugin to attach them (and specify the classifiers) see
http://mojo.codehaus.org/build-helper-maven-plugin/usage.html. The
actionscript code should be packaged up to produce a single artifact
(zip it up if a specific packaging format like swf won't do).

Kalle


On Wed, Dec 2, 2009 at 12:19 PM, K J <go...@gmail.com> wrote:
> Does anyone have any examples or tips about how to handle the
> generation of multiple artifacts based on a shared model? For example,
> I have a project which needs to produce both Java and ActionScript
> code based on a shared UML model. I'm having trouble figuring out how
> to best setup and manage these types of projects, so that a change to
> the source project can easily result in the build of all the various
> generated outputs.  Thanks in advance for the help.
>
> ---------------------------------------------------------------------
> 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: What is the 'Maven way' to handle multi-artifact code generation from a single model source?

Posted by K J <go...@gmail.com>.
Thanks for the input everyone.


On Thu, Dec 3, 2009 at 10:41 AM, Kalle Korhonen
<ka...@gmail.com> wrote:
> I wouldn't worry *too much* about the true and righteous way. While I
> agree that the more modular approach is more proper and allows for
> more flexibility, as with anything else, you need to strike a balance
> with building for future and practicality. With multiple modules,
> there comes additional complexity (that Maven arguably handles well)
> but if you never need the additional flexibility, then it's
> unnecessary. Regarding classifiers, I think they are fine if you
> always use them together (say same swf always goes with the same jar).
> I do completely agree with Maven's "one primary artifact per module"
> but depending on your case, the swf could be seen and treated as a
> secondary artifact, especially if you couldn't even test them
> separately. If you need to mix and match, perhaps have different
> release cycles for the swf and the jar, multiple modules is certainly
> better.
>
> Kalle
>
>
> On Wed, Dec 2, 2009 at 11:42 PM, Anders Hammar <an...@hammar.net> wrote:
>> I'd like to stress that Jesse explains the true Maven way. This is how this
>> should be done if you want to enjoy simple and correct dependency management
>> through Maven.
>> Using classifiers will make your two (for instance) artifacts have the same
>> dependencies. As I've stated before, classifiers are most often NOT the way
>> to go IMO.
>>
>> /Anders
>>
>> On Wed, Dec 2, 2009 at 22:40, Jesse Farinacci <ji...@gmail.com> wrote:
>>
>>> Hi KJ,
>>>
>>> On Wed, Dec 2, 2009 at 3:19 PM, K J <go...@gmail.com> wrote:
>>> > Does anyone have any examples or tips about how to handle the
>>> > generation of multiple artifacts based on a shared model? For example,
>>> > I have a project which needs to produce both Java and ActionScript
>>> > code based on a shared UML model. I'm having trouble figuring out how
>>> > to best setup and manage these types of projects, so that a change to
>>> > the source project can easily result in the build of all the various
>>> > generated outputs.  Thanks in advance for the help.
>>>
>>> To go the real Maven way, I think that I'd probably put the shared
>>> model data (perhaps some sort of XML?) into a Maven module. Then I'd
>>> have more Maven modules for Java and ActionScript, each, that would
>>> depend on the model data module. They would use it as a dependency and
>>> then generate their source codes accordingly.
>>>
>>> -jesse
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>

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


Re: What is the 'Maven way' to handle multi-artifact code generation from a single model source?

Posted by Kalle Korhonen <ka...@gmail.com>.
I wouldn't worry *too much* about the true and righteous way. While I
agree that the more modular approach is more proper and allows for
more flexibility, as with anything else, you need to strike a balance
with building for future and practicality. With multiple modules,
there comes additional complexity (that Maven arguably handles well)
but if you never need the additional flexibility, then it's
unnecessary. Regarding classifiers, I think they are fine if you
always use them together (say same swf always goes with the same jar).
I do completely agree with Maven's "one primary artifact per module"
but depending on your case, the swf could be seen and treated as a
secondary artifact, especially if you couldn't even test them
separately. If you need to mix and match, perhaps have different
release cycles for the swf and the jar, multiple modules is certainly
better.

Kalle


On Wed, Dec 2, 2009 at 11:42 PM, Anders Hammar <an...@hammar.net> wrote:
> I'd like to stress that Jesse explains the true Maven way. This is how this
> should be done if you want to enjoy simple and correct dependency management
> through Maven.
> Using classifiers will make your two (for instance) artifacts have the same
> dependencies. As I've stated before, classifiers are most often NOT the way
> to go IMO.
>
> /Anders
>
> On Wed, Dec 2, 2009 at 22:40, Jesse Farinacci <ji...@gmail.com> wrote:
>
>> Hi KJ,
>>
>> On Wed, Dec 2, 2009 at 3:19 PM, K J <go...@gmail.com> wrote:
>> > Does anyone have any examples or tips about how to handle the
>> > generation of multiple artifacts based on a shared model? For example,
>> > I have a project which needs to produce both Java and ActionScript
>> > code based on a shared UML model. I'm having trouble figuring out how
>> > to best setup and manage these types of projects, so that a change to
>> > the source project can easily result in the build of all the various
>> > generated outputs.  Thanks in advance for the help.
>>
>> To go the real Maven way, I think that I'd probably put the shared
>> model data (perhaps some sort of XML?) into a Maven module. Then I'd
>> have more Maven modules for Java and ActionScript, each, that would
>> depend on the model data module. They would use it as a dependency and
>> then generate their source codes accordingly.
>>
>> -jesse
>>
>> ---------------------------------------------------------------------
>> 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: What is the 'Maven way' to handle multi-artifact code generation from a single model source?

Posted by Anders Hammar <an...@hammar.net>.
I'd like to stress that Jesse explains the true Maven way. This is how this
should be done if you want to enjoy simple and correct dependency management
through Maven.
Using classifiers will make your two (for instance) artifacts have the same
dependencies. As I've stated before, classifiers are most often NOT the way
to go IMO.

/Anders

On Wed, Dec 2, 2009 at 22:40, Jesse Farinacci <ji...@gmail.com> wrote:

> Hi KJ,
>
> On Wed, Dec 2, 2009 at 3:19 PM, K J <go...@gmail.com> wrote:
> > Does anyone have any examples or tips about how to handle the
> > generation of multiple artifacts based on a shared model? For example,
> > I have a project which needs to produce both Java and ActionScript
> > code based on a shared UML model. I'm having trouble figuring out how
> > to best setup and manage these types of projects, so that a change to
> > the source project can easily result in the build of all the various
> > generated outputs.  Thanks in advance for the help.
>
> To go the real Maven way, I think that I'd probably put the shared
> model data (perhaps some sort of XML?) into a Maven module. Then I'd
> have more Maven modules for Java and ActionScript, each, that would
> depend on the model data module. They would use it as a dependency and
> then generate their source codes accordingly.
>
> -jesse
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: What is the 'Maven way' to handle multi-artifact code generation from a single model source?

Posted by Jesse Farinacci <ji...@gmail.com>.
Hi KJ,

On Wed, Dec 2, 2009 at 3:19 PM, K J <go...@gmail.com> wrote:
> Does anyone have any examples or tips about how to handle the
> generation of multiple artifacts based on a shared model? For example,
> I have a project which needs to produce both Java and ActionScript
> code based on a shared UML model. I'm having trouble figuring out how
> to best setup and manage these types of projects, so that a change to
> the source project can easily result in the build of all the various
> generated outputs.  Thanks in advance for the help.

To go the real Maven way, I think that I'd probably put the shared
model data (perhaps some sort of XML?) into a Maven module. Then I'd
have more Maven modules for Java and ActionScript, each, that would
depend on the model data module. They would use it as a dependency and
then generate their source codes accordingly.

-jesse

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