You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Artur &#346;miejowski (JIRA)" <ji...@codehaus.org> on 2008/07/11 12:07:26 UTC

[jira] Created: (MNG-3662) Ampersand in Windows username problem

Ampersand in Windows username problem
-------------------------------------

                 Key: MNG-3662
                 URL: http://jira.codehaus.org/browse/MNG-3662
             Project: Maven 2
          Issue Type: Bug
    Affects Versions: 2.0.9
         Environment: Windows Vista Small Business
            Reporter: Artur &#346;miejowski


Halo!

Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.

Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-3662) Ampersand in Windows username problem

Posted by "Artur Smiejowski (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=142718#action_142718 ] 

Artur Smiejowski commented on MNG-3662:
---------------------------------------

The main problem is when I use maven with appfuse 2.0.2. After creating project (it works ok) I want to run application with mvn jetty:run-war, and this couse error. Here is some console log:

D:\workspace\testworkspace\myproject>mvn jetty:run-war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.mycompany.app:myproject
POM Location: D:\workspace\testworkspace\myproject\pom.xml

Reason: Cannot read project model from interpolating filter of serialized versio
n. for project com.mycompany.app:myproject at D:\workspace\testworkspace\myproje
ct\pom.xml


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot read project model from
 interpolating filter of serialized version. for project com.mycompany.app:mypro
ject at D:\workspace\testworkspace\myproject\pom.xml
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.InvalidProjectModelException: Cannot read pr
oject model from interpolating filter of serialized version. for project com.myc
ompany.app:myproject at D:\workspace\testworkspace\myproject\pom.xml
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
aultMavenProjectBuilder.java:882)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFi
leInternal(DefaultMavenProjectBuilder.java:506)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMave
nProjectBuilder.java:198)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
        ... 11 more
Caused by: org.apache.maven.project.interpolation.ModelInterpolationException: C
annot read project model from interpolating filter of serialized version.
        at org.apache.maven.project.interpolation.RegexBasedModelInterpolator.in
terpolate(RegexBasedModelInterpolator.java:114)
        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLog
ic(DefaultMavenProjectBuilder.java:1025)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
aultMavenProjectBuilder.java:878)
        ... 16 more
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: entity refe
rence name can not contain character \' (position: START_TAG seen ...<jdbc.url>j
dbc:h2:C:\Users\Ada&Fin\... @611:44)
        at org.codehaus.plexus.util.xml.pull.MXParser.parseEntityRef(MXParser.ja
va:2222)
        at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:127
5)
        at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1093)
        at org.codehaus.plexus.util.xml.pull.MXParser.nextText(MXParser.java:105
8)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseProfile(MavenXpp3
Reader.java:3414)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseModel(MavenXpp3Re
ader.java:2239)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader.j
ava:4422)
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader.j
ava:4433)
        at org.apache.maven.project.interpolation.RegexBasedModelInterpolator.in
terpolate(RegexBasedModelInterpolator.java:105)
        ... 18 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Jul 22 11:29:45 CEST 2008
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------


I think that the problem is becouse of ampersand in the username - on other computer there is no problem with running application. Only on my laptop, where I have ampersand in the username.

Thanks in advice.
Artur.

> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3662) Ampersand in Windows username problem

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-3662:
------------------------------

    Fix Version/s: 2.0.11

scheduling for the patch to the batch file.

As for the parse error, what is actually putting the value in the POM? It should be writing &amp; instead.

> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>             Fix For: 2.0.11
>
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-3662) Ampersand in Windows username problem

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=147484#action_147484 ] 

Benjamin Bentmann commented on MNG-3662:
----------------------------------------

>From a mail Artur sent me today I got this snippet from his POM (I asked him to attach it here for further inspection, too):
{code:xml}
<jdbc.url><![CDATA[jdbc:h2:${java.io.tmpdir}/myapp]]></jdbc.url>
{code}

IIRC, the POM is parsed once, then serialized back into a string, this string is then interpolated and the result is parsed again into a Maven model. Apparently during serialization into string form, the original CDATA section markers are lost such that the second parsing step after interpolation is sensitive to XML metacharacters.

I am too familar with the POM interpolation but maybe we could just make the MavenXpp3Writer always wrap text with CDATA sections (if requested via some flag). This way, the interpolator doesn't need to care about XML escaping but can safely insert replacement values for the expressions.


> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>             Fix For: 2.0.11
>
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3662) Ampersand in Windows username problem

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3662:
-----------------------------------

    Attachment: escape-shell-chars.patch

The only problem I observed with the ampersand character was in the batch files launching Maven, more precisely in
{noformat}
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)
{noformat}
which causes something like "Jerry is not recognized as an internal or external command" when executing the {{set}} command for the user name "Tom&Jerry".

As outlined in the [Windows Command Shell Overview|http://technet2.microsoft.com/windowsserver/en/library/44500063-fdaf-4e4f-8dac-476c497a166f1033.mspx?mfr=true] and [KB-103368|http://support.microsoft.com/?scid=kb%3Ben-us%3B103368], the ampersand is a special character that needs escaping, e.g. by surrounding with quots.

If you encounter other errors besides the one mentioned, please provide a full debug log of Maven.

> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3662) Model interpolation crashes if property resolves to value with ampersand

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3662:
-----------------------------------

    Attachment:     (was: escape-shell-chars.patch)

> Model interpolation crashes if property resolves to value with ampersand
> ------------------------------------------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>             Fix For: 2.0.11
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3662) Ampersand in Windows username problem

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3662:
-----------------------------------

    Component/s: Command Line

> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3662) Model interpolation crashes if property resolves to value with ampersand

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3662:
-----------------------------------

    Component/s:     (was: Command Line)
                 Inheritance and Interpolation
        Summary: Model interpolation crashes if property resolves to value with ampersand  (was: Ampersand in Windows username problem)

> Model interpolation crashes if property resolves to value with ampersand
> ------------------------------------------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>             Fix For: 2.0.11
>
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-3662) Ampersand in Windows username problem

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=147484#action_147484 ] 

bentmann edited comment on MNG-3662 at 9/9/08 4:01 PM:
----------------------------------------------------------------

>From a mail Artur sent me today I got this snippet from his POM (I asked him to attach it here for further inspection, too):
{code:xml}
<jdbc.url><![CDATA[jdbc:h2:${java.io.tmpdir}/myapp]]></jdbc.url>
{code}

IIRC, the POM is parsed once, then serialized back into a string, this string is then interpolated and the result is parsed again into a Maven model. Apparently during serialization into string form, the original CDATA section markers are lost such that the second parsing step after interpolation is sensitive to XML metacharacters.

I am not familar with the POM interpolation but maybe we could just make the MavenXpp3Writer always wrap text with CDATA sections (if requested via some flag). This way, the interpolator doesn't need to care about XML escaping but can safely insert replacement values for the expressions.


      was (Author: bentmann):
    From a mail Artur sent me today I got this snippet from his POM (I asked him to attach it here for further inspection, too):
{code:xml}
<jdbc.url><![CDATA[jdbc:h2:${java.io.tmpdir}/myapp]]></jdbc.url>
{code}

IIRC, the POM is parsed once, then serialized back into a string, this string is then interpolated and the result is parsed again into a Maven model. Apparently during serialization into string form, the original CDATA section markers are lost such that the second parsing step after interpolation is sensitive to XML metacharacters.

I am too familar with the POM interpolation but maybe we could just make the MavenXpp3Writer always wrap text with CDATA sections (if requested via some flag). This way, the interpolator doesn't need to care about XML escaping but can safely insert replacement values for the expressions.

  
> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>             Fix For: 2.0.11
>
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-3662) Model interpolation crashes if property resolves to value with ampersand

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-3662.
----------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s:     (was: 2.0.11)
                   2.1.0-M1
                   3.0-alpha-1

This was fixed by refactoring of the model interpolation in both Maven 2.1.x (by John) and 3.x (by Shane).

> Model interpolation crashes if property resolves to value with ampersand
> ------------------------------------------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>            Assignee: Benjamin Bentmann
>             Fix For: 3.0-alpha-1, 2.1.0-M1
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3662) Ampersand in Windows username problem

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3662:
-----------------------------------

    Patch Submitted: [Yes]

> Ampersand in Windows username problem
> -------------------------------------
>
>                 Key: MNG-3662
>                 URL: http://jira.codehaus.org/browse/MNG-3662
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.9
>         Environment: Windows Vista Small Business
>            Reporter: Artur Smiejowski
>         Attachments: escape-shell-chars.patch
>
>
> Halo!
> Maven don't work when In Windows user has ampersand in the name for example username=Tom&Jerry. Windows allows usernames like this, but Maven treat ampersand in the name of users main folder as a part of some url (?) or something ... and cannot get path properly. Windows do not allow to change username with all user's foldernames.
> Artur

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira