You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steve Garcia <sg...@media-publisher.com> on 2003/05/10 00:32:54 UTC

General Maven Help

I'm new to Maven, I've read the majority of the documentation about it.  I have a bunch of questions which undoubtedly arise from the lack of documentation, but I've made do by trying things out myself and only performing general maven tasks (compile, jar, and doc generation is about it).  Any help on these questions would be great:

I'm using the 1.0-beta-9 distribution.

1) Is there any documentation on all of the configurable properties, i.e.${maven.jarResources.basedir}, ${basedir}, etc.?  I suppose some of these are defined by the specific plugins/goals, but the whole idea behind the nomenclature of these properties eludes me.  Why specify ${basedir} and not ${maven.basedir}?  Is ${pom.*} the same as ${project.*}?   I haven't found a concise, one page list of all the properties that can be set.  

Is ${maven.home}/bin/driver.properties supposed to exist?  (it doesn't for me and it isn't in the maven binary distribution).

Also, I see that in a property file on can specify something like 

prop.myprop.a=${some.other.prop}blah

What process/code handles the property expansion?  Is this some specific API developed by Jakarta, or is this library part of the JDK distribution?  I think its really cool but I haven't seen it before.

It seems to me there are two root locations for everything that Maven needs to deal with, ${project*} which is specific to your project you are working on, and ${maven*} which is where maven is installed.  Yet I see references to ${basedir}, ${maven.home}, ${project.home}, ${maven.basedir}, I just don't see any consistency.  I'm all confused.  Can somebody clarify this?

2) I am trying to port our project to use Maven, and I have some philosophical questions about project structure/layout.

Maven recommends at the root of your project to have:

src/
src/test
src/uitest
src/announcements
xdocs/
xdocs/navigation.xml
xdocs/tasks.xml
project.properties
build.properties

Maven creates (by default)

target
target/classes
target/test-classes
target/uitest-classes
target/generated-docs
target/test-reports
target/docs/...
target/

a. is every directory location listed above (in both categories) able to be explicity declared to Maven?  For instance, can I name the target dir to "mylittlefishy"?  How about the target path?  Can Maven build not to MAVEN_HOME/target but to c:\some\dir? 

b. we have configuration files, db scripts, log files, and a bunch of other junk, Maven definitely needs to copy all of these directories to the "target" dir when it does a build. All of these have to be specified in the <resources> element in the <build> node in the project.xml?  

3) The Maven repository framework is pretty cool, I'm wondering if folks within organizations set up their own master (remote) repository in conjunction with the Maven repository.  Because in the end the vast majority of projects outside of Jakarta use non-jakarta jars.  In addition, all developers can point to that internal repository as well as the Maven ibibilido repository so we don't copy jars all over the place (sounds reasonable).


Thanks in advance, Steve


Re: General Maven Help

Posted by nicolas frank <ni...@laposte.net>.
Waoouu, too many questions, but I will try to answer some of them with my
current (growing each day a little more...) knowledge of maven...

----- Original Message ----- 
From: "Steve Garcia" <sg...@media-publisher.com>
To: <us...@maven.apache.org>
Sent: Saturday, May 10, 2003 12:32 AM
Subject: General Maven Help


> I'm new to Maven, I've read the majority of the documentation about it.  I
have a bunch of questions which undoubtedly arise from the lack of
documentation, but I've made do by trying things out myself and only
performing general maven tasks (compile, jar, and doc generation is about
it).  Any help on these questions would be great:
>
> I'm using the 1.0-beta-9 distribution.
>
> 1) Is there any documentation on all of the configurable properties,
i.e.${maven.jarResources.basedir}, ${basedir}, etc.?  I suppose some of
these are defined by the specific plugins/goals, but the whole idea behind
the nomenclature of these properties eludes me.  Why specify ${basedir} and
not ${maven.basedir}?  Is ${pom.*} the same as ${project.*}?   I haven't
found a concise, one page list of all the properties that can be set.

Currently the documentation is very small. It's a good way to start but not
enough to understand the all stuff (but it's growing and become better...)

A good introduction can be found at:

http://www-106.ibm.com/developerworks/java/library/j-maven/


>
> Is ${maven.home}/bin/driver.properties supposed to exist?  (it doesn't for
me and it isn't in the maven binary distribution).
>
> Also, I see that in a property file on can specify something like
>
> prop.myprop.a=${some.other.prop}blah
>
> What process/code handles the property expansion?  Is this some specific
API developed by Jakarta, or is this library part of the JDK distribution?
I think its really cool but I haven't seen it before.
>

Don't you know ant ? ${myproperty} comes (but maybe I am wrong) from there
(and you can know find it in the JSTL). Maven use jelly script language (and
in maven you can insert in directly ant scripts in it).


> It seems to me there are two root locations for everything that Maven
needs to deal with, ${project*} which is specific to your project you are
working on, and ${maven*} which is where maven is installed.  Yet I see
references to ${basedir}, ${maven.home}, ${project.home}, ${maven.basedir},
I just don't see any consistency.  I'm all confused.  Can somebody clarify
this?
>

${basedir} = the base directory of your project (where the project.xml is).
the other ones, I don't really know... but the best way to find out is to
check in plugins (in the maven directory /plugins) in the plugin.jelly,
which contains all jelly scripts for plugins which use theise properties...

...ok it's not always easy to know what a properties comes for (usualy
$pom... are for the project.xml manipulation), and you know what, this can
be even harder as any plugin can define its own set of properties !

For example the war plugin defines a maven.war.final.name...

you can find it in the plugin.jelly (<property name="maven.war.final.name"
value="${pom.artifactId}.war"/>)
usually, you find public plugin properties (the one you are supposed to
overide for customization), in the plugin.properties

... and worth, you can define yourself new properties in your maven.xml
(where you can create your own goals an custom existing goals...), and even
make it a new plugin with horrible undocumented properties ;-) .


> 2) I am trying to port our project to use Maven, and I have some
philosophical questions about project structure/layout.
>
> Maven recommends at the root of your project to have:
>
> src/
> src/test
> src/uitest
> src/announcements
> xdocs/
> xdocs/navigation.xml
> xdocs/tasks.xml
> project.properties
> build.properties
>
> Maven creates (by default)
>
> target
> target/classes
> target/test-classes
> target/uitest-classes
> target/generated-docs
> target/test-reports
> target/docs/...
> target/
>
> a. is every directory location listed above (in both categories) able to
be explicity declared to Maven?  For instance, can I name the target dir to
"mylittlefishy"?  How about the target path?  Can Maven build not to
MAVEN_HOME/target but to c:\some\dir?

Maven is just a system that execute jelly scripts, so yes you can do
anything you want... but you won't easily use all the plugins that other
people provide freely for you (even if most of the time you can with a good
pregoal setup). You can always change the maven.build property in the
pregoal of the java:compile (<preGoal name="java:compile"> or the
java:prepare-filesystem )


>
> b. we have configuration files, db scripts, log files, and a bunch of
other junk, Maven definitely needs to copy all of these directories to the
"target" dir when it does a build. All of these have to be specified in the
<resources> element in the <build> node in the project.xml?
>

Same as previous...


> 3) The Maven repository framework is pretty cool, I'm wondering if folks
within organizations set up their own master (remote) repository in
conjunction with the Maven repository.  Because in the end the vast majority
of projects outside of Jakarta use non-jakarta jars.  In addition, all
developers can point to that internal repository as well as the Maven
ibibilido repository so we don't copy jars all over the place (sounds
reasonable).
>

That's what I do (and I guess most people do...). Add this in the
build.properties in your home folder...

>
> Thanks in advance, Steve
>
>

Last comments : Yes maven is still not easy to start with (still a beta,
don't forget that), but it is a wonderfull piece of sofware that can really
improve your build system... so it really worse the time you spend learning
it...





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003


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