Your solution actually gave me a NullPointerException (in plexus-filtering),
because ${*} is replaced by "the value of property *" in the pom.
So you have to use
<delimiter>$${*}</delimiter> (It took me a while to figure out that
the ${ } is escaped by doubling the dollar sign :-))
Here's the jira issue I filed for improving the docs:
http://jira.codehaus.org/browse/MRESOURCES-115
Regards,
Karel
On Mon, Jan 11, 2010 at 9:08 AM, Karel Vervaeke <[email protected]> wrote:
> Thanks!
>
> On Sat, Jan 9, 2010 at 5:36 PM, Olivier Lamy <[email protected]> wrote:
>> Hi,
>> You can try with configuring the resources mojo as this :
>>
>> <useDefaultDelimiters>false</useDefaultDelimiters>
>> <delimiters>
>> <delimiter>${*}</delimiter>
>> </delimiters>
>>
>> The @ won't be use as delimiter.
>>
>> --
>> Olivier
>>
>> 2010/1/8 Karel Vervaeke <[email protected]>:
>>> I'm having difficulties with resource filtering
>>>
>>> In my pom I have:
>>>
>>> <resource>
>>> <targetPath>some path</targetPath>
>>> <filtering>true</filtering>
>>> <directory>${basedir}/src/main/xpatch</directory>
>>> <includes><include>*</include></includes>
>>> </resource>
>>> ....
>>> <plugin>
>>> <groupId>org.apache.maven.plugins</groupId>
>>> <artifactId>maven-resources-plugin</artifactId>
>>> <configuration>
>>> <escapeString>\</escapeString>
>>> </configuration>
>>> </plugin>
>>>
>>> in src/main/xpatch I have:
>>>
>>> <?xml version="1.0"?>
>>> <patches xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>>> <patch xpath="/runtime/containers"
>>> remove="artifa...@id='competent']"/>
>>> <patch xpath="/runtime/containers"
>>> remove="artifa...@id='doctasks']"/>
>>> <patch xpath="/runtime/containers" insert-after="artifa...@id='workflow']">
>>> <artifact id="doctasks" groupId="daisy"
>>> artifactId="daisy-doctaskrunner-server-impl" version="${myversion}"/>
>>> <artifact id="doctasks" groupId="daisy"
>>> artifactId="daisy-doctaskrunner-server-impl" version="${myversion} "/>
>>> <artifact id="workflow" groupId="daisy"
>>> artifactId="daisy-workflow-server-impl" version="${myversion}"/>
>>> </patch>
>>> </patches>
>>>
>>> In the output, ${myversion} is not replaced.
>>> I have determined that the problem is caused by the fact that the @ is also
>>> a
>>>
>>> I have also tried escaping the @ using the escape string defined in the pom,
>>> but then the output looks like this::
>>> <patch xpath="/runtime/containers"
>>> remove="artifa...@id='competent']"/>
>>>
>>> <patch xpath="/runtime/containers"
>>> remove="artifac...@id='doctasks']"/>
>>>
>>> <patch xpath="/runtime/containers"
>>> insert-after="artifac...@id='workflow']">
>>> ...
>>>
>>> (The first \@ is escaped, but for the others nothing happens. IIUC
>>> this has to do with the fact that the escape string is used to escape
>>> pairs of at signs, but that seems like a strange way to handle
>>> things).
>>>
>>> I found some more info here:
>>> http://maven.apache.org/shared/maven-filtering/, but nothing that
>>> helped
>>> In the end I ended up defining a property at=@ and using ${at} in my
>>> resource, which works but isn't very nice.
>>>
>>> Does anyone have ideas about this?
>>> Regards,
>>> Karel0
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>>
>>
>> --
>> Olivier
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]