Message: The following issue has been closed.
--------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/MAVEN-315 Here is an overview of the issue: --------------------------------------------------------------------- Key: MAVEN-315 Summary: Jelly scripting in maven.xml Type: Bug Status: Closed Priority: Critical Resolution: WON'T FIX Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: maven Components: jelly/ant integration Versions: 1.0-beta-9 Assignee: Reporter: Incze Lajos Created: Wed, 5 Mar 2003 5:23 PM Updated: Tue, 21 Sep 2004 8:19 AM Environment: RedHat 8.0 all patches, j2sdk-1.4.1_01, maven HEAD Description: Jelly scripting in maven.xml is somehow not safe. The script attached sets the namlenX vairable in various ways, and then tries to use the values. The variable is set, the value is correct, but using it as parameter in a call like somestring.substring(namlenX) sometimes misteriously fails. The attached script tries to be self explaining and comes from a real life example. When run the attached script namlen1, namlen2 does not work, namlen3 work. A piece of a run shows this output: [EMAIL PROTECTED] emnl-transform]$ maven emnl:test __ __ | \/ |__ Jakarta _ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0-beta-9-SNAPSHOT Attempting to download commons-jelly-SNAPSHOT.jar. Attempting to download commons-jelly-tags-xml-SNAPSHOT.jar. Attempting to download commons-jelly-tags-jsl-SNAPSHOT.jar. emnl:test: [echo] srcbase ........ /opt/data/archive [echo] source ......... /opt/data/archive/jav/08/01jav.sgm [echo] namlen1 ........ srcbase.length()+1 ... 18 [echo] namlen2 ........ size(srcbase)+1 ... 18 [echo] namlen3 ........ source.toString().indexOf('j') ... 18 [echo] filename ....... source.getName() ... 01jav.sgm [echo] dirname ........ source.getParent() ... /opt/data/archive/jav/08 [echo] ext ............ filename.lastIndexOf('.') ... 5 [echo] basename ext ... filename.substring(0,ext) ... 01jav [echo] reldir_18 ...... dirname.substring(18) ... jav/08 [echo] reldir1 ........ dirname.substring(namlen1) ... [echo] reldir2 ........ dirname.substring(namlen2) ... [echo] reldir3 ........ dirname.substring(namlen3) ... jav/08 [echo] reldirJoke ..... dirname.substring(ext) ... data/archive/jav/08 [echo] reldir4 ........ dirname.substring(srcbase.length()) ... /jav/08 [echo] reldir5 ........ dirname.substring(srcbase.length()+1) ... [echo] srcbase ........ /opt/data/archive [echo] source ......... /opt/data/archive/jav/08/02jav.sgm [echo] namlen1 ........ srcbase.length()+1 ... 18 [echo] namlen2 ........ size(srcbase)+1 ... 18 [echo] namlen3 ........ source.toString().indexOf('j') ... 18 [echo] filename ....... source.getName() ... 02jav.sgm [echo] dirname ........ source.getParent() ... /opt/data/archive/jav/08 [echo] ext ............ filename.lastIndexOf('.') ... 5 [echo] basename ext ... filename.substring(0,ext) ... 02jav [echo] reldir_18 ...... dirname.substring(18) ... jav/08 [echo] reldir1 ........ dirname.substring(namlen1) ... [echo] reldir2 ........ dirname.substring(namlen2) ... [echo] reldir3 ........ dirname.substring(namlen3) ... jav/08 [echo] reldirJoke ..... dirname.substring(ext) ... data/archive/jav/08 [echo] reldir4 ........ dirname.substring(srcbase.length()) ... /jav/08 [echo] reldir5 ........ dirname.substring(srcbase.length()+1) ... ... etc. =============================== The worrst of all, that seemingly the usability of the namleX depends on HOW (??) it was set. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]