[ 
http://jira.codehaus.org/browse/MRESOURCES-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=130398#action_130398
 ] 

Denis Sadowski commented on MRESOURCES-59:
------------------------------------------

I filter a number of property files with @property@ using version 2.2, and it 
usually works fine.

For example if a file has the following line:

Current Version : @property@

or 

[EMAIL PROTECTED]@.jar



However, filtering becomes an issue if @ symbols are present inside of the file 
and are not indicative of a property. Example:

[EMAIL PROTECTED] filters @property@ in file

The property will fail to filter, but in the following only one of the two 
properties filter:

[EMAIL PROTECTED] filters @property@ @ @property@ in file

The first will still fail to filter, but the second will filter.



>From what I can see when it finds an @, it pairs it with the next @ and 
>evaluates whats in between as a property, then continues to filter from the 
>next character after the second @.



Also, if the last character in a filtered file is an upaired @, example:

[EMAIL PROTECTED] @property@ @

the following exception is thrown during Maven execution:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:687)
        at org.apache.maven.plugin.resources.util.InterpolationFilterReader.read
(InterpolationFilterReader.java:193)
        at org.apache.maven.plugin.resources.util.InterpolationFilterReader.read
(InterpolationFilterReader.java:201)
        at org.apache.maven.plugin.resources.util.InterpolationFilterReader.read
(InterpolationFilterReader.java:162)
        at java.io.Reader.read(Reader.java:123)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:212)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:200)
        at org.apache.maven.plugin.resources.ResourcesMojo.copyFile(ResourcesMoj
o.java:269)
        at org.apache.maven.plugin.resources.ResourcesMojo.copyResources(Resourc
esMojo.java:183)
        at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
.java:100)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:447)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        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)



> filtering with @property@
> -------------------------
>
>                 Key: MRESOURCES-59
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-59
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Stefano Fornari
>
> From the source code, it looks like @property@ should be expanded as well. It 
> does not work with the tests I've done

-- 
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

        

Reply via email to