You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yann Albou <ya...@club-internet.fr> on 2012/05/06 22:04:06 UTC

Filtering not working after at sign

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

--
View this message in context: http://maven.40175.n5.nabble.com/Filtering-not-working-after-at-sign-tp5689637.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filtering not working after at sign

Posted by Yann Albou <ya...@club-internet.fr>.
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

--
View this message in context: http://maven.40175.n5.nabble.com/Filtering-not-working-after-at-sign-tp5689637p5692884.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filtering not working after at sign

Posted by Olivier Lamy <ol...@apache.org>.
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 <ya...@club-internet.fr>:
>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filtering not working after at sign

Posted by Yann Albou <ya...@club-internet.fr>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filtering not working after at sign

Posted by Wayne Fay <wa...@gmail.com>.
> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filtering not working after at sign

Posted by Yann Albou <ya...@club-internet.fr>.
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.


--
View this message in context: http://maven.40175.n5.nabble.com/Filtering-not-working-after-at-sign-tp5689637p5690537.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filtering not working after at sign

Posted by Wayne Fay <wa...@gmail.com>.
> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org