i am very new to this too, so the following may not be the best approach,
but what i have done is create some archetypes with poms that have entries
like
<!-- MODULE-INSERT -->
and
<!-- DEPENDENCY-INSERT -->
i also have some bash scripts that use these archetypes to let me add
sub-projects to my system. the scripts do the following:
- instantiate an archetype at the appropriate position
- construct the correct module/dependency links by running sed on the
various pom.xml involved
for example, here is a fragment of a script that creates a sub-project
(module):
mvn archetype:create -DarchetypeGroupId="edu.noao.nsa" \
-DarchetypeArtifactId="project-impl-archetype" \
-DarchetypeVersion="0.1" \
-Dversion="$VERSION" \
-DgroupId="edu.noao.nsa" \
-DartifactId="$SERVICE"
# if we have an interface then the main project depends on the
# messaging system
if [ $iface ]
then
pushd "$SERVICE"
sed -i -e "s/\\(^.*\\)\\(<\!-- DEPENDENCY-INSERT -->\\)/
<dependency>\\n <groupId>edu.noao.nsa<\\/groupId>\\n
<artifactId>messaging<\\/artifactId>\\n
<version>$VERSION<\\/version>\\n <\\/dependency>\\n\\n\\1\\2/"
pom.xml
popd
fi
sed -i -e "s/\\(^.*\\)\\(<\!-- MODULE-INSERT
-->\\)/\\1<module>$SERVICE<\\/module>\\n\\1\\2/" pom.xml
if you follow the sed replacement carefully you'll see that it takes a pom
like
<dependencies>
<!-- DEPENDENCY-INSERT -->
</dependencies>
and produces one like:
<dependencies>
<dependency>
<groupId>edu.noao.nsa</groupId>
<artifactId>mulex</artifactId>
<version>123</version>
<scope>compile</scope>
</dependency>
<!-- DEPENDENCY-INSERT -->
</dependencies>
so that the process can repeat.
i don't know if that is any help!
andrew
Romain Rouvoy wrote:
> Hi,
>
> Thank you for the link, I forgot this documentation!
>
> But anyway, when I run the "mvn site" command, Maven creates 3
> websites (1/module + 1 for the project) split in the directory tree :- (
... Does it means that basically, maven can not aggregate module
websites in the project website ?
>
> Moreover, I do not know the best way of managing the examples that
> can be provided with a project.. creating dedicated modules will make my
project grown exponentially :-/ unless I create recursively
> modules into my project modules ?
>
> regards,
> romain
>
>
> Le 17 janv. 06 à 12:43, Robert Taylor a écrit :
>> > I found no documentation on multi-module projects except this "In
progress" one:
>> > http://maven.apache.org/guides/mini/guide-multi-module.html
>> See the Getting Started section:
>> "How do I build more than one project at once?"
>> http://maven.apache.org/guides/getting-started/index.html
>> Also, maven comes with an example project called "greeter" which
demonstrates multi-project builds.
>> /robert
>> Romain Rouvoy wrote:
>>> Hi,
>>> I use Maven for few days now and I find it very powerful but I need
some help/feedback from experimented users.
>>> Basically, I have a project that is split into several modules. Each
module is a simple Java project that contains a piece of the web site
and several examples for users.
>>> Using maven2, I have created a POM project which contains several sub-
modules using the following directory tree:
>>> my-project/
>>> - pom.xml
>>> - sub-module1/
>>> - pom.xml
>>> - src/
>>> - sub-module2/
>>> - pom.xml
>>> - src/
>>> - sub-module3/
>>> - pom.xml
>>> - src/
>>> My questions are:
>>> * How can I build the my-project web site that groups all the sub-
modules websites using Maven ?
>>> * Where should I store my examples ? In sub-module1/examples/
>>> directory ? In a sub-module1/src/examples/ ? Or in sub-module-
examples/src ?
>>> I found no documentation on multi-module projects except this "In
progress" one:
>>> http://maven.apache.org/guides/mini/guide-multi-module.html
>>> regards,
>>> Romain
>
--
` __ _ __ ___ ___| |_____ personal site: http://www.acooke.org/andrew
/ _` / _/ _ \/ _ \ / / -_) blog: http://www.acooke.org/cute
\__,_\__\___/\___/_\_\___| aim: acookeorg; skype: andrew-cooke
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]