You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jerome Lacoste <je...@coffeebreaks.org> on 2004/06/02 17:41:47 UTC
how to make multiproject dependencies work
I am trying to get multiproject dependencies work. But am having a hard
time. The doc didn't seem to contain the answers to my question.
My idea is to test the multiproject functionality doing the following
project/core
project/web
I then need core to be built before web.
Detailed Setup:
---------------
I have 3 project.xml files
on in project/ and one in each of the sub projects.
In each project.xml I have something like that
<extend>../project.xml</extend> (this only in the sub projects)
<pomVersion>3</pomVersion> (same pom version)
<id>fullex-web</id> (different for each project)
<groupId>org.cb.test</groupId> (same groupId)
The web one contains a dependency on the artifact built by the core
project.
something like
<dependency>
<groupId>org.cb.test</groupId>
<id>fullex-core</id>
<version>0.1</version>
<url>http://localhost/</url>
</dependency>
in the project.properties for the web project I have something like
maven.jar.override=on
maven.jar.fullex-core=${basedir}/../core/target/fullex-core-0.1.jar
In the root maven.xml I've added the reactor example found in the doc.
<goal name="all" description="build all modules">
<maven:reactor
basedir="${basedir}"
postProcessing="true"
includes="*/project.xml"
goals="all"
banner="Building full project"
ignoreFailures="false"
>
</maven:reactor>
<j:forEach var="reactorProject" items="${reactorProjects}">
</j:forEach>
</goal>
Problem:
--------
But when I run maven, it keeps trying to build web before core.
Here is the extract of maven -X:
[...]
attaining goal build:start
attaining goal all
Starting the reactor...
Using userBuildPropertiesFile: /home/jerome/build.properties
Using projectPropertiesFile:
/home/jerome/Dev/FullExample/AWebApp/project.properties
Using projectBuildPropertiesFile:
/home/jerome/Dev/FullExample/AWebApp/build.properties
Using userBuildPropertiesFile: /home/jerome/build.properties
Using projectPropertiesFile:
/home/jerome/Dev/FullExample/project.properties
Using projectBuildPropertiesFile:
/home/jerome/Dev/FullExample/build.properties
Using projectBuildPropertiesFile:
/home/jerome/Dev/FullExample/build.properties
Using projectPropertiesFile:
/home/jerome/Dev/FullExample/project.properties
Using userBuildPropertiesFile: /home/jerome/build.properties
Using projectPropertiesFile:
/home/jerome/Dev/FullExample/core/project.properties
Using projectBuildPropertiesFile:
/home/jerome/Dev/FullExample/core/build.properties
Using projectBuildPropertiesFile:
/home/jerome/Dev/FullExample/build.properties
Using projectPropertiesFile:
/home/jerome/Dev/FullExample/project.properties
Our processing order:
Tests FullExample (Web)
Tests FullExample (CORE)
Questions:
---------
- how do I enforce the order? Did I miss something?
- is the publishing of my jar file in a local repository the recommended
approach? Or should I use the dependency overriding (which has the
inconvenient of requiring an exact path, containing the version number)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
dependency should use not (was Re: how to make
multiproject dependencies work)
Posted by Jerome Lacoste <je...@coffeebreaks.org>.
On Wed, 2004-06-02 at 23:42, Dan Tran wrote:
> Jerome,
>
> take a look at this link
> http://wiki.codehaus.org/maven/CreatingJ2eeApplications
>
> I base mine on that example and it works like a champ
>
> hope it helps
it helped a lot ;)
I found my problem to be a dependency declaration one:
in the block
<dependency>
<groupId>org.cb.test</groupId>
<id>fullex-core</id>
<version>0.1</version>
<url>http://localhost/</url>
</dependency>
I should have used artifactId instead of id. Not really sure why...
I wonder where I picked that, because I've used id in all my former
examples and it worked all the time (for non multiprojects)...
I guesses I picked that in an example, and it worked since then.
I also uncovered an inconsistency in the dependency declaration, but I will report that to the dev team.
Cheers,
Jerome
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: how to make multiproject dependencies work
Posted by Dan Tran <da...@hotmail.com>.
Jerome,
take a look at this link
http://wiki.codehaus.org/maven/CreatingJ2eeApplications
I base mine on that example and it works like a champ
hope it helps
-Dan
----- Original Message -----
From: "Jerome Lacoste" <je...@coffeebreaks.org>
To: <us...@maven.apache.org>
Sent: Wednesday, June 02, 2004 8:41 AM
Subject: how to make multiproject dependencies work
> I am trying to get multiproject dependencies work. But am having a hard
> time. The doc didn't seem to contain the answers to my question.
>
> My idea is to test the multiproject functionality doing the following
>
> project/core
> project/web
>
> I then need core to be built before web.
>
>
> Detailed Setup:
> ---------------
>
> I have 3 project.xml files
>
> on in project/ and one in each of the sub projects.
>
> In each project.xml I have something like that
>
> <extend>../project.xml</extend> (this only in the sub projects)
> <pomVersion>3</pomVersion> (same pom version)
> <id>fullex-web</id> (different for each project)
> <groupId>org.cb.test</groupId> (same groupId)
>
> The web one contains a dependency on the artifact built by the core
> project.
>
> something like
>
> <dependency>
> <groupId>org.cb.test</groupId>
> <id>fullex-core</id>
> <version>0.1</version>
> <url>http://localhost/</url>
> </dependency>
>
> in the project.properties for the web project I have something like
>
> maven.jar.override=on
> maven.jar.fullex-core=${basedir}/../core/target/fullex-core-0.1.jar
>
> In the root maven.xml I've added the reactor example found in the doc.
> <goal name="all" description="build all modules">
> <maven:reactor
> basedir="${basedir}"
> postProcessing="true"
> includes="*/project.xml"
> goals="all"
> banner="Building full project"
> ignoreFailures="false"
> >
> </maven:reactor>
> <j:forEach var="reactorProject" items="${reactorProjects}">
>
> </j:forEach>
> </goal>
>
>
> Problem:
> --------
>
> But when I run maven, it keeps trying to build web before core.
>
> Here is the extract of maven -X:
>
> [...]
> attaining goal build:start
> attaining goal all
> Starting the reactor...
> Using userBuildPropertiesFile: /home/jerome/build.properties
> Using projectPropertiesFile:
> /home/jerome/Dev/FullExample/AWebApp/project.properties
> Using projectBuildPropertiesFile:
> /home/jerome/Dev/FullExample/AWebApp/build.properties
> Using userBuildPropertiesFile: /home/jerome/build.properties
> Using projectPropertiesFile:
> /home/jerome/Dev/FullExample/project.properties
> Using projectBuildPropertiesFile:
> /home/jerome/Dev/FullExample/build.properties
> Using projectBuildPropertiesFile:
> /home/jerome/Dev/FullExample/build.properties
> Using projectPropertiesFile:
> /home/jerome/Dev/FullExample/project.properties
> Using userBuildPropertiesFile: /home/jerome/build.properties
> Using projectPropertiesFile:
> /home/jerome/Dev/FullExample/core/project.properties
> Using projectBuildPropertiesFile:
> /home/jerome/Dev/FullExample/core/build.properties
> Using projectBuildPropertiesFile:
> /home/jerome/Dev/FullExample/build.properties
> Using projectPropertiesFile:
> /home/jerome/Dev/FullExample/project.properties
> Our processing order:
> Tests FullExample (Web)
> Tests FullExample (CORE)
>
>
> Questions:
> ---------
>
> - how do I enforce the order? Did I miss something?
>
> - is the publishing of my jar file in a local repository the recommended
> approach? Or should I use the dependency overriding (which has the
> inconvenient of requiring an exact path, containing the version number)
>
>
>
> ---------------------------------------------------------------------
> 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