Hi,

Perhaps you misunderstood when I stated:

"... On the other hand it is also possible to build only comp1 by calling the appropriate goals directly in the folder project/comp1. ..."

Doing :

$cd project/comp2; maven %artifact_creation_goal_name%

will NOT trigger the build of comp1. So make sure the artifact created by project/comp1 is already available in the local/central repository!.

In order to build all components, you should do:

$cd project/master; maven %multiproject_goal_name%

Regards,
Davy Toch
IT-Consultant
Steria SA/NV


[EMAIL PROTECTED] wrote:

I am missing something fundmental. Even with this layout,
the goals in comp1/ do not trigger the attainment of
goals in comp1/:

$ cd comp1; maven
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

build:start:

java:prepare-filesystem:

java:compile:
[echo] Compiling to /vob/nm_dcm/cs/target/classes
[echo]

^C (abort maven)
$
$ cd ../comp2; maven
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

Attempting to download dcm-cs-1.0-SNAPSHOT.jar.
Response content length is not known
Error retrieving artifact from [http://maven-plugins.sf.net/maven/dcm/jars/dcm-cs-1.0-SNAPSHOT.jar]: java.io.IOException: Unknown error downloading; status code was: 302
WARNING: Failed to download dcm-cs-1.0-SNAPSHOT.jar.
The build cannot continue because of the following unsatisfied dependency:

dcm-cs-1.0-SNAPSHOT.jar

Total time: 14 seconds
Finished at: Thu Sep 15 11:49:31 PDT 2005

$

Why is the build in comp2/ not triggering the build in comp1?
I will understand if you want to give up on this thread.

Thanks,

Rk
x77309

On Thu, 15 Sep 2005, Davy Toch wrote:

Hi,

Apparently the indentation of the proposed project structure wasn't kept so will pad with '...'.

project/
...master/
......project.xml :
......... * just a POM to extend from
......... * can contain dependencies like log4j, commons-logging (already available on ibiblio) ...... maven.xml : contains multiproject goals to be executed on comp1/, comp2/, ...
...... project.properties : contains maven.multiproject.includes, ...
... comp1/
...... project.xml :
......... * extend from ../master/project.xml
... comp2/
...... project.xml :
......... * extend from ../master/project.xml
......... * depends on artifact generated by comp1
... app/
...... project.xml:
......... * extend from ../master/project.xml
......... * depends on artifacts generated by comp1 and comp2

This way the whole application can be built by calling the appropriate multiproject goals in the directory project/master. On the other hand it is also possible to build only comp1 by calling the appropriate goals directly in the folder project/comp1. This structure also avoids problems when working with the Eclipse IDE.




[EMAIL PROTECTED] wrote:

> Hi,
> > Thanks for your clarification. One thing puzzles me:
> > > You should be aware that when you run a goal on a Maven project, > one of > > the first things that is done is resolving/retrieving the > dependencies. > > So running 'rh:build' in the folder 'rh' will first try to resolve the
> > dependency 'dcm-cs', which will fail.
> > Isn't "resolving" a dependency identifying that the prerequisite > artifact (dcm-cs.jar) does not exist and hence trigger the build of the > prerequisite? > > It seems to me that toplevel (rh) should orchestrate the build of the > subprojects. > If I move the project.xml and maven.xml out of toplevel, what would be > the behaviour of multiproject:install in rh/ folder? Or are you > suggesting
> that toplevel build must commence from rh/apps?
> > Again, thanks!
> > Rk
> x77309
> > On Thu, 15 Sep 2005, Davy Toch wrote:
> > > Hi,
> > > > Your project structure has the following problems:
> > > > The parent folder 'rh' contains a maven.xml file that calls the > > multiproject goal. I suppose you expect this multiproject goal to call > > rh:build in the 'cs' folder first and then the dependency dcm-cs in > > the project 'rh' would be resolved without a problem. However this is > > not what happens. You should be aware that when you run a goal on a > > Maven project, one of the first things that is done is > > resolving/retrieving the dependencies. So running 'rh:build' in the > > folder 'rh' will first try to resolve the dependency 'dcm-cs', which > > will fail. > > > > Another problem I noticed is an infinite loop problem. As a test, you > > should put the dependency to dcm-cs in rh/project.xml in comments and > > run maven rh:build in the 'rh' folder afterwards. You'll see you're in > > an infinite loop because the goal rh:build in rh/maven.xml folder will > > execute on **all** projects except 'common' (so also on itself). > > > > Solution for the above problems : move rh/project.xml to > > rh/app/project.xml (this will also make the <extend> in the POMs more > > consistent). Also copy rh/maven.xml to rh/app/maven.xml but remove the > > multiproject part should be removed in the latter. > > > > Also : http://jira.codehaus.org/browse/MPMULTIPROJECT-55 > > (unfortunately I didn't get any feedback on this from the Maven guru's > > :-( ).
> > > > Regards,
> > Davy Toch
> > IT-Consultant
> > Steria SA/NV
> > > > [EMAIL PROTECTED] wrote:
> > > > > A minor(?) correction: the directory of dcm-cs
> > > is named "cs", while its artifact is named dcm-cs.
> > > So the dir structure is as follows:
> > > > > > (rh
> > > (common)
> > > (cs) ;; produces dcm-cs.jar
> > > ) > > > Thanks,
> > > > > > Rk
> > > x77309
> > > > > > On Thu, 15 Sep 2005, [EMAIL PROTECTED] wrote:
> > > > > > > Env:
> > > > ====
> > > > JDK 5.0
> > > > Maven 1.0.2
> > > > Multiproject plugin: 1.3.1
> > > > > Context:
> > > > ========
> > > > I have setup a multiproject dependency as follows:
> > > > (rh
> > > > (common)
> > > > (dcm-cs)
> > > > ) > where both rh and dcm-cs extend ${basedir}common/project.xml
> > > > and rh depends on dcm-cs.
> > > > > I have also defined a custom goal rh:build in toplevel and in
> > > > dcm-cs as follows:
> > > > > // In rh/maven.xml ...
> > > > //
> > > > <goal name="rh:build">
> > > > <ant:echo>
> > > > Building RH toplevel...
> > > > </ant:echo>
> > > > <j:set var="goal" value="rh:build" />
> > > > <ant:mkdir dir="${maven.build.dir}" />
> > > > <attainGoal name="multiproject:goal"/>
> > > > </goal>
> > > > > // In cs/maven.xml ...
> > > > //
> > > > <goal name="rh:build" prereqs="jar:install">
> > > > <ant:echo>
> > > > Building RH Common Services...
> > > > </ant:echo>
> > > > </goal>
> > > > > > > > Problem:
> > > > ========
> > > > rh:build at the toplevel does not trigger rh:build in cs; instead > > > > it attempts to download dcm-cs-1.0.jar from the local repository:
> > > > > > $ cd rh; maven -X
> > > > //...
> > > > Using default goal: rh:build
> > > > running script null
> > > > [available] [VERBOSE] Unable to find src/main/java to set property
> > > > sourcesPresent
> > > > [available] [VERBOSE] Unable to find src/test/java to set property
> > > > unitTestSourcesPresent
> > > > [DEBUG] Adding reference: maven-classpath ->
> > > > [DEBUG] Adding reference: maven.compile.src.set ->
> > > > Verifying dependencies for dcm:dcm
> > > > Getting failed dependencies:
> > > > [EMAIL PROTECTED]
> > > > Attempting to download dcm-cs-1.0.jar.
> > > > Getting URL:
> > > > http://roundhouse-repository.cisco.com/maven/dcm/jars/dcm-cs-1.0.jar
> > > > Received status code: 404
> > > > File not found on one of the repos
> > > > java.io.FileNotFoundException:
> > > > http://roundhouse-repository.cisco.com/maven/dcm/jars/dcm-cs-1.0.jar
> > > > at
> > > > org.apache.maven.util.HttpUtils.retrieveArtifact(HttpUtils.java:590)
> > > > at org.apache.maven.util.HttpUtils.getFile(HttpUtils.java:395)
> > > > //...
> > > > > > Additional Info:
> > > > ================
> > > > > (a) Relevant excerpt from Parent project.xml > > > (rh/common/project.xml):
> > > > > <project>
> > > > <pomVersion>3</pomVersion>
> > > > <groupId>dcm</groupId>
> > > > <name>elidedname>
> > > > > <!-- The version of the project under development, e.g.
> > > > <currentVersion>1.0</currentVersion>
> > > > //...
> > > > </project>
> > > > > > (b) Relevant excerpt from rh project.xml (rh/project.xml):
> > > > > <project>
> > > > <extend>${basedir}/common/project.xml</extend>
> > > > > <name>RH Project</name>
> > > > <artifactId>dcm</artifactId>
> > > > > <dependencies>
> > > > <dependency>
> > > > <groupId>dcm</groupId>
> > > > <artifactId>dcm-cs</artifactId>
> > > > <version>${pom.currentVersion}</version>
> > > > <type>jar</type>
> > > > </dependency>
> > > > //...
> > > > </project>
> > > > > > (c) Relevant excerpt from cs project.xml (rh/cs/project.xml):
> > > > > <project>
> > > > <extend>${basedir}/common/project.xml</extend>
> > > > > <name>RH Common services</name>
> > > > <artifactId>dcm-cs</artifactId>
> > > > > <dependencies>
> > > > <dependency>
> > > > <groupId>mortbay</groupId>
> > > > <artifactId>org.mortbay.jetty</artifactId>
> > > > <version>1.0</version>
> > > > <type>jar</type>
> > > > </dependency>
> > > > </dependencies>
> > > > //...
> > > > </project>
> > > > > > (d) Relevant excerpt from rh/project.properties:
> > > > > maven.multiproject.basedir=${basedir}
> > > > maven.multiproject.includes=**/project.xml
> > > > maven.multiproject.excludes=common/project.xml
> > > > > > Any help greatly appreciated!
> > > > > Thanks,
> > > > > Rk
> > > > x77309
> > > > > > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > > > > > > > > > > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> > >

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to