You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by bo...@werken.com on 2003/03/06 00:23:10 UTC

[maven-bug] Created: (MAVEN-315) Jelly scripting in maven.xml

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:

  http://jira.werken.com/secure/ViewIssue.jspa?key=MAVEN-315


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-315
    Summary: Jelly scripting in maven.xml
       Type: Bug

     Status: Assigned
   Priority: Critical

 Time Spent: Unknown
   Estimate: 0 minutes

    Project: maven
  Component: jelly-integ
   Versions:
             1.0-beta-9

   Assignee: Jason van Zyl
   Reporter: Incze Lajos

    Created: Wed, 5 Mar 2003 5:23 PM
    Updated: Wed, 5 Mar 2003 5:23 PM
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:

[incze@senorg 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.werken.com/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira