You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stefan Rademacher <Ra...@hhla.de> on 2005/12/20 14:04:13 UTC

Antw: RE: Which variables are available, e.g. for thexdoclet-maven-plugin?

Hi,

thanks for your reply. It was already "a little helpful". But I have one further question:
Obviously I can't find out all available variables in this way. For example the variable ${java.home} (which is used on http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) is available, but is set somwhere else. 

Does anybody know, where these variables are initialized and where I can find them? Additionally I would like to set some variables on my own. I just don't understand the mechanism behind this.

thanks a lot in advance,
Stefan

>>> oliveros@cpqd.com.br 19.12.2005 19:56 >>>
Hi,

AFAIK this variable (project.build.outputDirectory) comes from pom.xml as follows:

<project>
...
	<build>
		<outputDirectory>target/classes</outputDirectory>
	</build>
...
</project>

Hope this helps.
Dário



-----Original Message-----
From: Stefan Rademacher [mailto:Rademacher@hhla.de] 
Sent: segunda-feira, 19 de dezembro de 2005 13:35
To: <Maven Users List
Subject: Which variables are available, e.g. for
thexdoclet-maven-plugin?


Hello,

on the page for the xdoclet-maven-plugin there is an example, which
contains a variable ${project.build.outputDirectory}.
Where can I find out generally, which variables are available in a
pom.xml? And another question is: Can I define my own variables
somwhere?

Would be great, if anyone can tell me.
Bye,
Stefan

---------------------------------------------------------------------
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 



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


Re: Antw: RE: Which variables are available, e.g. for thexdoclet-maven-plugin?

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
You can add a section to the pom like this:

   <properties>
     <ppw.javaSourceDirectory>src/main/java</ppw.javaSourceDirectory>
     <ppw.torytSourceDirectory>src/test/toryt</ppw.torytSourceDirectory>
     ...
   </properties>

and access those properties as ${ppw.javaSourceDirectory} and  
${ppw.torytSourceDirectory}.


For the rest: you are absolutely right. It is impossible to find out  
which properties do exist. For us, ${project.build.outputDirectory}  
does not work, whatever the docs say. Point is, these must be some  
ant/velocity style properties that are defined somewhere, hard coded.  
It would be incredibly helpful if maven would phase that out, and  
instead use an EL, like Commons EL or OGNL.

To see what doesn't work, we use ant echo's bound to some phase, like  
this:

<build>
...
      <plugins>
      ....
      <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
           <execution>
             <phase>validate</phase>
             <configuration>
               <tasks>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                 <echo>user.name: ${user.name}</echo>
                 <echo>pom: ${pom}</echo>
                 <echo>settings: ${settings}</echo>
                 <echo>pom.groupId: ${pom.groupId}</echo>
                 <echo>pom.artifactId: ${pom.artifactId}</echo>
                 <echo>pom.packaging: ${pom.packaging}</echo>
                 <echo>pom.name: ${pom.name}</echo>
                 <echo>pom.description: ${pom.description}</echo>
                 <echo>pom.url: ${pom.url}</echo>
                 <echo>pom.mailingLists: ${pom.mailingLists}</echo>
                 <echo>pom.developers: ${pom.developers}</echo>
                 <echo>pom.scm.connection: ${pom.scm.connection}</echo>
                 <echo>pom.organization: ${pom.organization}</echo>
                 <echo>project: ${project}</echo>
                 <echo>maven: ${maven}</echo>
                 <echo>maven.project: ${maven.project}</echo>
                 <echo>project.build.sourceDirectory:  
${project.build.sourceDirectory}</echo>
                 <echo>pom.build: ${project.build}</echo>
                 <echo>toedeloe: ${toedeloe}</echo>
                 <echo>user.language: ${user.language}</echo>
                 <echo>user.country: ${user.country}</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
                  
<echo>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</echo>
               </tasks>
             </configuration>
             <goals>
               <goal>run</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>




On 20 Dec 2005, at 14:04, Stefan Rademacher wrote:

> Hi,
>
> thanks for your reply. It was already "a little helpful". But I have  
> one further question:
> Obviously I can't find out all available variables in this way. For  
> example the variable ${java.home} (which is used on  
> http://maven.apache.org/guides/introduction/introduction-to- 
> dependency-mechanism.html) is available, but is set somwhere else.
>
> Does anybody know, where these variables are initialized and where I  
> can find them? Additionally I would like to set some variables on my  
> own. I just don't understand the mechanism behind this.
>
> thanks a lot in advance,
> Stefan
>
>>>> oliveros@cpqd.com.br 19.12.2005 19:56 >>>
> Hi,
>
> AFAIK this variable (project.build.outputDirectory) comes from pom.xml  
> as follows:
>
> <project>
> ...
> 	<build>
> 		<outputDirectory>target/classes</outputDirectory>
> 	</build>
> ...
> </project>
>
> Hope this helps.
> Dário
>
>
>
> -----Original Message-----
> From: Stefan Rademacher [mailto:Rademacher@hhla.de]
> Sent: segunda-feira, 19 de dezembro de 2005 13:35
> To: <Maven Users List
> Subject: Which variables are available, e.g. for
> thexdoclet-maven-plugin?
>
>
> Hello,
>
> on the page for the xdoclet-maven-plugin there is an example, which
> contains a variable ${project.build.outputDirectory}.
> Where can I find out generally, which variables are available in a
> pom.xml? And another question is: Can I define my own variables
> somwhere?
>
> Would be great, if anyone can tell me.
> Bye,
> Stefan
>
> ---------------------------------------------------------------------
> 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
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/