title: Velocity Engine split() returns String instead of Array
body: <p>I am using mvn archetype:generate to templatize some stuff in my project. I'm running into some trouble with the Maven 3.2.2 Velocity Engine split() method. I havent been able to figure out specifically what version of Velocity Maven is using.</p>
  
  <pre><code>#set($foo = "one:a, two:b, three:c")
  $!foo
  $foo.split(",")
  
  #foreach($bar in $foo.split(","))
      $!bar
      $bar.split(":")
  
      #set($number = $bar.split(":").get(0))
      number = $!number
  
      #set($letter = $bar.split(":").get(1))
      letter = $!letter
  #end
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>one:a, two:b, three:c
  ['one:a', 'two:b', 'three:c']
  
  one:a
  ['one', 'a']
  number = one
  letter = a
  
  two:b
  ...
  </code></pre>
  
  <p>Actual output:</p>
  
  <pre><code>one:a, two:b, three:c
  [Ljava.lang.String;@6cff380
  
  one:a
  [Ljava.lang.String;@5a587f23
  number =
  letter = 
  
  two:b
  [Ljava.lang.String;@2c8b586a
  ...
  </code></pre>
  
  <p>As you can see, the first split() used in the #foreach block works as I expect splitting the string by commas and iterating over the three substrings, but when I print $bar.split(":") I get that weird String pointer and #set($number = $bar.split(":").get(0)) prints nothing because .get() is being called on a String instead of an Array. With that in mind I was able to come up with this horrible hack:</p>
  
  <pre><code>#foreach ($bar in $foo.split(","))
      #set ($i = 0)
      #foreach($hack in $bar.split(":"))
          #if($i == 0)
              #set ($number = $hack)
          #else
              #set ($letter = $hack)
          #end
          #set($i = $i + 1)
      #end
  number = $number
  letter = $letter
  #end
  </code></pre>
  
  <p>But there has to be a better way, I cannot use this code in good conscience. I've been using Velocity for a grand total of 3 hours so I am surely to blame here, what does #foreach know that I don't? </p>
  
  <p>Thanks for the help.</p>
  
  <p>Edit: according to <a href="http://mvnrepository.com/artifact/org.apache.maven.archetype/archetype-common/2.2" rel="nofollow">this</a> maven archetype is using Velocity Engine 1.5</p>