Quantcast

Filtering not working after at sign

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Filtering not working after at sign

Yann Albou
Hello,

If in file, where filtering is activated, I have <annotation>@${project.artifactId}</annotation>
then ${project.artifactId} won't be replaced.

If i do the same test with the at sign after ${project.artifactId} then it wil be replaced.

Should I fill a bug ? where ?
Thanks
Yann
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filtering not working after at sign

Wayne Fay
> If in file, where filtering is activated, I have
> <annotation>@${project.artifactId}</annotation>
> then ${project.artifactId} won't be replaced.
>
> If i do the same test with the at sign after ${project.artifactId} then it
> wil be replaced.

I don't understand your complaint. Until I know better, I will assume
you are unclear about how filtering works and have not actually found
a bug in the code.

Please read and understand this:
http://maven.apache.org/shared/maven-filtering/
and this:
http://maven.apache.org/shared/maven-filtering/usage.html

If you still believe you have found an issue, please write up a more
comprehensive explanation with a fuller example, ideally even a full
Maven project with sample files and pom configuration etc that
demonstrates the issue.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filtering not working after at sign

Yann Albou
Hello,

Sorry for being unclear...
In a simple maven jar project I have the following pom:
<project ...>
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.test.mvn</groupId>
        <artifactId>mvnTestFiltering</artifactId>
        <packaging>jar</packaging>
        <name>mvnTestFiltering</name>
        <version>1.0.0-SNAPSHOT</version>
        <build>
                <resources>
                        <resource>
                                <filtering>true</filtering>
                                <directory>src/main/resources</directory>
                        </resource>
                </resources>
        </build>
</project>


and in dir "src/main/resources" I created a file "myResource.xml" containing:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">

        <bean name="${project.artifactId}_Listener1" class="org.test.MyClass">
                <annotation>@${project.artifactId}</annotation>
        </bean>

</deployment>


After executing mvn resources:resources the resulting "myResource.xml" in "target/classes" dir is

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">

        <bean name="mvnTestFiltering_Listener1" class="org.test.MyClass">
                <annotation>@${project.artifactId}</annotation>
        </bean>

</deployment>

The second "${project.artifactId}" has not been replaced because of the @ sign...
After reading http://maven.apache.org/shared/maven-filtering/ I saw token @@ are interpolated. I guess my issue could be link to this ?


Thanks
Yann.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filtering not working after at sign

Wayne Fay
> The second "${project.artifactId}" has not been replaced because of the @
> sign...
> After reading http://maven.apache.org/shared/maven-filtering/ I saw token @@
> are interpolated. I guess my issue could be link to this ?

Yes. What version of Maven are you using?

If you aren't using @@ token, you should turn it off. That is
described in the docs.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filtering not working after at sign

Yann Albou
Wayne Fay wrote
Yes. What version of Maven are you using?

If you aren't using @@ token, you should turn it off. That is
described in the docs.
I use maven 3.0.3
Sorry but I don't see in the doc where to turn off the interpolation of @@ token, could you help ?

Thanks
Yann.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filtering not working after at sign

olamy
Salut,
Have a look at the delimiters fields:
http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters
with useDefaultDelimiters to false.

Should work.

2012/5/7 Yann Albou <[hidden email]>:

>
> Wayne Fay wrote
>>
>> Yes. What version of Maven are you using?
>>
>> If you aren't using @@ token, you should turn it off. That is
>> described in the docs.
>>
>>
>
> I use maven 3.0.3
> Sorry but I don't see in the doc where to turn off the interpolation of @@
> token, could you help ?
>
> Thanks
> Yann.
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Filtering-not-working-after-at-sign-tp5689637p5691396.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Filtering not working after at sign

Yann Albou

merci Olivier ;-)

it works if I do:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
                <useDefaultDelimiters>false</useDefaultDelimiters>
                <delimiters>
                        <delimiter>${*}</delimiter>
                </delimiters>
        </configuration>
</plugin>

Thanks
Yann
Loading...