You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@multitask.com.au on 2003/02/24 00:51:21 UTC

Output of text in goals

I have a bizarre situation, that before I file a bug I wanted to check if 
anyone had seen this before.

I've got a goal:

  <goal name="audit:create-licenses">
    <!--
     ! parse audit file
     ! run ssh to create each <groupId>/licenses directory.
     !-->
     <x:parse xml="repository-audit.xml" var="audit" />
     <echo>audit = ${audit}</echo>
 
     <x:forEach var="group" select="$audit/licenses/project/groupId">
       <!-- next line is bizarre -->
       <echo>groupId = ${group.text}</echo>
     </x:forEach>
  </goal>

That <echo>'s some text

If I change the 'bizarre' line above from an <echo> to just text, i.e.
       groupId = ${group.text}

I get no output, e.g.
----------8<-----------------------
audit:create-licenses:
    [echo] audit = org.dom4j.tree.DefaultDocument@40984b [Document: name 
file:/C
:/source/jakarta/jakarta-turbine-maven/repository-audit.xml]
BUILD SUCCESSFUL
Total time:  8 seconds
----------8<-----------------------

Changing the bizzare line to 
       groupId = ${group}
produces:
----------8<-----------------------
.tree.DefaultElement@2e7c6a [Element: <groupId attributes: []/>]groupId = 
org.do
m4j.tree.DefaultElement@6a5461 [Element: <groupId attributes: []/>]groupId 
= org
.dom4j.tree.DefaultElement@49cf9f [Element: <groupId attributes: 
[]/>]groupId =
org.dom4j.tree.DefaultElement@5e0b5e [Element: <groupId attributes: 
[]/>]groupId
 = org.dom4j.tree.DefaultElement@3c5596 [Element: <groupId attributes: 
[]/>]grou
pId = org.dom4j.tree.DefaultElement@170c0e [Element: <groupId attributes: 
[]/>]g
roupId = org.dom4j.tree.DefaultElement@187197 [Element: <groupId 
attributes: []/
>]groupId = org.dom4j.tree.DefaultElement@497904 [Element: <groupId 
attributes:
[]/>]groupId = org.dom4j.tree.DefaultElement@27f9dc [Element: <groupId 
attribute
s: []/>]groupId = org.dom4j.tree.DefaultElement@4e28b [Element: <groupId 
attribu
tes: []/>]groupId = org.dom4j.tree.DefaultElement@354362 [ElemenBUILD 
SUCCESSFUL
Total time:  5 seconds
----------8<-----------------------

Can anyone explain why the last set produces output whereas the second 
doesn't?
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au