Interesting.  I think I have found some unpacking elements in the assembly
plugin when I write my own descriptor.  So it may be possible... needs more
research.

I think I understand what you are saying about separating the config from
the binaries.  But I'm not sold on the idea of creating it in a different
project.  The way I'm trying to do it, the code + the config is completely
separate, i.e. its not jar'ed with the classes and I do not have any issues
with duplication.  The code and the config is a tightly linked enitity so I
feel uneasy about splitting them into 2 separate projects (albeit linked by
a dependency). 

What concerns me most is I feel that doing it this way would be a work
around for the way maven builds, i.e. I'm starting to think my project does
not seem to fit nicely with maven way of doing things :/

Thanks again for all you help, I'm not giving up on maven yet but I think I
need to take a more in depth look at gradle and see if it fits this any
better.

Thanks,
Jon.


Ron Wheeler wrote:
> 
> On 09/11/2010 9:03 AM, Anders Hammar wrote:
>> I think you should start by separating the configurations from your
>> binaries. Then it will be so much easier creating the custom zip you
>> want.
>> You would also avoid having the configuration files duplicated (like
>> outisde
>> the jars as well as inside some of the jars). That will sooner or later
>> get
>> you or someone else into trouble.
> +1  I have been a victim of this practice. Very unpleasant.
>> /Anders
>>
>> On Tue, Nov 9, 2010 at 14:14, jon.mithe<jon.mi...@gmail.com>  wrote:
>>
>>> Hi,
>>>
>>> I'm trying to switch over to maven for a project I developing in work,
>>> new
>>> to maven and finding packaging it a little tricky.
>>>
>>> The app I am writing has a core framework module and then a bunch of
>>> other
>>> modules that provide plugin like functionality.  The idea being I can
>>> produce different builds with different combinations of modules /
>>> functionality.  The confusing bit is each module specifies its own
>>> configs
>>> +
>>> other config like resources and these must be aggregated together in the
>>> build. So my project:
>>>
>>> Parent  Project
>>> --Core Module
>>> ---- src/main/java
>>> ---- src/main/config
>>> ---- src/main/other_resource_directory
>>> --Module A
>>> ---- src/main/java
>>> ---- src/main/config
>>> ---- src/main/other_resource_directory
>>> --Module B
>>> ---- src/main/java
>>> ---- src/main/config
>>> ---- src/main/other_resource_directory
>>>
>>> needs to go to the final package / zipped artifact:
>>>
>>> ./core.jar
>>> ./moduleA.jar
>>> ./moduleB.jar
>>> ./config/<all configs accross all modules>
>>> ./other_resource_directory/<all other resources accross all modules>
>>>
>>> As I understand, I need to use the maven-assembly-plugin to do most of
>>> this,
>>> and to include the custom directories I need.
>>>
>>> I think I need to define each module artifact as a zip file with the
>>> target
>>> jar in it and the 2 folders.  Which involves writing an assembly plugin
>>> instance in the plugin management of the parent POM and my own assembly
>>> descriptor.  The idea being I can reference the plugin as an artifact in
>>> each of my sub modules, i.e:
>>> <plugin><artifactId>module-bundle</artifactId></plugin>.
>>>
>>> So I think that may work for each of my sub-modules, but I have no idea
>>> then
>>> how to process these artifacts to aggregate this into a zip in the
>>> format
>>> above.  I think the artifact is I would get atm is a jar containing all
>>> the
>>> zipped artifacts from each modules.  So when that artifact is being
>>> created
>>> I need to process the zips from the modules / unpackage each module and
>>> copy
>>> configs across etc.
>>>
>>> Talked to a friend who said maybe this is not quite within the maven way
>>> and
>>> he suggested gradle may be worthwhile looking into but am quite
>>> interested
>>> to know if this should be possible in maven.
>>>
>>> Thanks for any help figuring this out,
>>> Jon
>>> --
>>> View this message in context:
>>> http://maven.40175.n5.nabble.com/Custom-assembly-of-multi-module-project-tp3256773p3256773.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: users-h...@maven.apache.org
>>>
>>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> 

-- 
View this message in context: 
http://maven.40175.n5.nabble.com/Custom-assembly-of-multi-module-project-tp3256773p3257165.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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

Reply via email to