maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy>
Subject What is the variable scoping in Maven?
Date Mon, 03 Jan 2005 16:58:54 GMT
Thanks for the quick reply to my last question about referencing 
maven.depedency.classpath in maven.xml

Does anyone know if there's a definitive guide to varibale scoping in 
Maven?  Right now, I'm unsure how to proceed with my multi-project 
setup.  It confuses me.  I have the following directories/projects based 
on a sample multi-project I saw online (app is not the actual name of my 

* maven.root - the multiproject root
* app-lib
* app-jms (depends on lib)
* app-gui (depends on lib, jms)

Each of the projects has a and project.xml. The version 
is currently 1.0-dev.
app-jms has a maven.xml to run a post-processor as a preGoal before jar:jar

Each subproject's project.xml extends maven.root:

Most of the external dependencies are in maven.root, while 'internal' 
dependencies are defined in each subproject.  For example, app-jms will 

My in maven.root is:

My in jms is like:
maven.multiproject.type = jar
maven.jar.override      = on    = ../lib/target/app-lib-1.0-dev.jar


1) Are settings inherited when project.xml is inherited?

2) Can/how (do) we define variables in project.xml?  I assume those are 

3) Can project.xml members be references in project.xml?  I really don't 
like hardcoding the filenames of the internal subproject dependencies in and project.xml.  For example can I do something like 
the following (this currently doesn't work):

3b)  Or better yet, not even define the <jar/> but just have it know 
that it's in 

4) Can/how (do) I reference all of this in maven.xml?  I'd like it so 
when the jars are built that they are copied over to a top level 
directory '/deploy'  So based on the answer to question 1, it may work 
to put maven.deploy.dir in maven.root/ right?  And is 
there a way I can tell it exactly to include app-lib-1.0-dev.jar without 
resorting to *.jar?
<postGoal name="jar:jar">
    <copy todir="${maven.deploy.dir}>
    <fileset dir="${basedir}/target/">
       <include name="*.jar">

-Randy X

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message