Hi all,

I ran into something funny. I created a very simple Ant build:

build.xml:
<project>
       <echoproperties/>
       <echo>${user.home}</echo>
</project>

Running 'ant' yields lots of properties and it prints my home
directory, as expected.

Buildfile: build.xml
[echoproperties] #Ant properties
[echoproperties] #Tue Sep 26 17:45:52 PDT 2006
[echoproperties] java.runtime.name=Java(TM) 2 Runtime Environment,
Standard Edition
:
<snip/>
:
[echoproperties] user.home=/home/userid
:
<snip/>
:
[echoproperties] sun.cpu.isalist=
    [echo] /home/userid

BUILD SUCCESSFUL
Total time: 0 seconds

I then tried to set up Maven2 as a wrapper around this Ant build.

pom.xml:
<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>a</groupId>
   <artifactId>a</artifactId>
   <version>1</version>
   <build>
       <plugins>
           <plugin>
               <artifactId>maven-antrun-plugin</artifactId>
               <executions>
                   <execution>
                       <phase>package</phase>
                       <configuration>
                           <tasks>
                               <ant/>
                           </tasks>
                       </configuration>
                       <goals>
                           <goal>run</goal>
                       </goals>
                   </execution>
               </executions>
               <dependencies>
                   <dependency>
                       <groupId>ant</groupId>
                       <artifactId>optional</artifactId>
                       <version>1.5.4</version>
                   </dependency>
               </dependencies>
           </plugin>
       </plugins>
   </build>
</project>

Running 'mvn package' yields surprisingly little output:
[INFO] Scanning for projects...
:
<snip/>
:
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[echoproperties] #Ant properties
[echoproperties] #Tue Sep 26 17:42:31 PDT 2006
[echoproperties] ant.file=/home/userid/maven_puzzle/build.xml
[echoproperties] ant.file.null=/home/userid/maven_puzzle/build.xml
[echoproperties] ant.project.name=DummyProject
[echoproperties] ant.java.version=1.4
[echoproperties] basedir=/home/userid/maven_puzzle
    [echo] ${user.home}
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Sep 26 17:42:31 PDT 2006
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------

None of the Java system properties are available! Does anyone know why
this is happening? Am I missing an Ant dependency (I thought this was
core Ant functionality)?

Very puzzled,
Hilco

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

Reply via email to