Strange behaviour

16 views
Skip to first unread message

grimsell

unread,
Aug 7, 2009, 9:02:18 AM8/7/09
to maven-config-processor-users
I'm back from my vaccation now and are about to start using maven-
config-processor in our project and test out the new feature you guys
implemented for us. Thanks a lot by the way :)

However I'm stuck on some basig stuff.
I'm trying to add a property but the result is that an existing
property is removed.

This is my setup:
Original file:
faa=value5
foo=value2
fuu=value3

Processing config:
<processor>
<add>
<name>fee</name>
<value>value1</value>
<after>foo</after>
</add>
</processor>

Plugin-config:
<plugin>
<groupId>com.google.code.maven-config-processor-plugin</groupId>
<artifactId>maven-config-processor-plugin</artifactId>
<version>1.7-SNAPSHOT</version>
<configuration>
<encoding>ISO-8859-1</encoding>
<transformations>
<transformation>
<type>properties</type>
<input>file:${project.build.directory}/iipax-zip/etc/webstart/
application.config.inst.client</input>
<output>modified-files/etc/webstart/
application.config.inst.client</output>
<config>src/main/assembly/client-properties-processing.xml</
config>
</transformation>
</transformations>
</configuration>
<executions>
<execution>
<id>config-process</id>
<phase>process-resources</phase>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>


And this is the result I get:
faa=value5
fee=value1
fuu=value3


As you see the foo property is removed. This is not what I expected.
Am I missing something here?

Leandro de Oliveira

unread,
Aug 7, 2009, 10:58:21 AM8/7/09
to maven-config-p...@googlegroups.com
Hi,

This behavior is a side effect of the last features that have been added.
It's fixed in this snapshot:
http://oss.sonatype.org/content/repositories/googlecode-snapshots/com/google/code/maven-config-processor-plugin/maven-config-processor-plugin/1.8-SNAPSHOT/maven-config-processor-plugin-1.8-20090807.144550-1.pom

You need to add the sonatype snapshots repo in your pom.xml:

<pluginRepositories>
<pluginRepository>
<id>OSS Sonatype</id>
<url>http://oss.sonatype.org/content/repositories/googlecode-snapshots</url>
</pluginRepository>
</pluginRepositories>

And declare the plugin version like this:

<groupId>com.google.code.maven-config-processor-plugin</groupId>
<artifactId>maven-config-processor-plugin</artifactId>
<version>1.8-20090807.144550-1</version>

Unfortunately, the version 1.7 is already in the maven central
repository, we will have to generate a new release to make this fix
official. If there are no more bugs, can we release version 1.8 on
August 14th so we can have a stable version with all these new
features?

Please, let me know if you have more issues.

2009/8/7 grimsell <grim...@gmail.com>:

grimsell

unread,
Aug 11, 2009, 2:42:48 AM8/11/09
to maven-config-processor-users
Yes, now it works much better.
I will try to configure all part of our project with MCP this week.
You'll hear from me soon if I have any more feedback.

Thanks for your help.

On Aug 7, 4:58 pm, Leandro de Oliveira <lehph...@gmail.com> wrote:
> Hi,
>
> This behavior is a side effect of the last features that have been added.
> It's fixed in this snapshot:http://oss.sonatype.org/content/repositories/googlecode-snapshots/com...
>
> You need to add the sonatype snapshots repo in your pom.xml:
>
> <pluginRepositories>
>   <pluginRepository>
>     <id>OSS Sonatype</id>
>     <url>http://oss.sonatype.org/content/repositories/googlecode-snapshots</url>
>   </pluginRepository>
> </pluginRepositories>
>
> And declare the plugin version like this:
>
> <groupId>com.google.code.maven-config-processor-plugin</groupId>
> <artifactId>maven-config-processor-plugin</artifactId>
> <version>1.8-20090807.144550-1</version>
>
> Unfortunately, the version 1.7 is already in the maven central
> repository, we will have to generate a new release to make this fix
> official. If there are no more bugs, can we release version 1.8 on
> August 14th so we can have a stable version with all these new
> features?
>
> Please, let me know if you have more issues.
>
> 2009/8/7 grimsell <grims...@gmail.com>:

grimsell

unread,
Aug 11, 2009, 2:52:28 AM8/11/09
to maven-config-processor-users
One thing I forgot.
The documentation for the plugin configuration should change since the
input parameter should be a proper URL.
http://code.google.com/p/maven-config-processor-plugin/wiki/PluginConfiguration

grimsell

unread,
Aug 11, 2009, 7:40:15 AM8/11/09
to maven-config-processor-users
I've now started to test the new find/replace feature.

When using this configuration everything works as expected.
<processor>
<modify>
<find>Notering</find>
<replace>Minnesanteckning</replace>
</modify>
</processor>

All properties with a occurance of "Notering" in their value are
processed.
But when I add another rule nothing changes at all.

<processor>
<modify>
<find>Notering</find>
<replace>Minnesanteckning</replace>
</modify>
<modify>
<find>Tjänsteanteckning</find>
<replace>Dagbokshändelse</replace>
</modify>
</processor>


On Aug 11, 8:52 am, grimsell <grims...@gmail.com> wrote:
> One thing I forgot.
> The documentation for the plugin configuration should change since the
> input parameter should be a proper URL.http://code.google.com/p/maven-config-processor-plugin/wiki/PluginCon...

Leandro de Oliveira

unread,
Aug 11, 2009, 10:32:41 AM8/11/09
to maven-config-p...@googlegroups.com
>> The documentation for the plugin configuration should change since the
>> input parameter should be a proper URL.http://code.google.com/p/maven-config-processor-plugin/wiki/PluginCon...

We need to update/add a lot of documentation. I will update it in small bits.

> All properties with a occurance of "Notering" in their value are
> processed.
> But when I add another rule nothing changes at all.

It's indeed a bug, it's fixed on this snapshot:
http://oss.sonatype.org/content/repositories/googlecode-snapshots/com/google/code/maven-config-processor-plugin/maven-config-processor-plugin/1.8-SNAPSHOT/maven-config-processor-plugin-1.8-20090811.142855-2.pom

Thank you for your accurate bug descriptions, it's very helpful! I
hope we don't find too much more bugs ;-)

2009/8/11 grimsell <grim...@gmail.com>:

grimsell

unread,
Aug 11, 2009, 11:28:12 AM8/11/09
to maven-config-processor-users
I tested your snapshot.
Now "Notering" is being raplaced by "Minnesanteckning" but
"Tjänsteanteckning" is being left untouched.

PS. Thank you for your quick updates they are very helpful too :)

On Aug 11, 4:32 pm, Leandro de Oliveira <lehph...@gmail.com> wrote:
> >> The documentation for the plugin configuration should change since the
> >> input parameter should be a proper URL.http://code.google.com/p/maven-config-processor-plugin/wiki/PluginCon...
>
> We need to update/add a lot of documentation. I will update it in small bits.
>
> > All properties with a occurance of "Notering" in their value are
> > processed.
> > But when I add another rule nothing changes at all.
>
> It's indeed a bug, it's fixed on this snapshot:http://oss.sonatype.org/content/repositories/googlecode-snapshots/com...
>
> Thank you for your accurate bug descriptions, it's very helpful! I
> hope we don't find too much more bugs ;-)
>
> 2009/8/11 grimsell <grims...@gmail.com>:

grimsell

unread,
Aug 12, 2009, 9:27:13 AM8/12/09
to maven-config-processor-users
It seems like its the swedish characters in "Tjänsteanteckning" that
causes the problems.
I'm not sure why though :)

Leandro de Oliveira

unread,
Aug 12, 2009, 9:53:01 AM8/12/09
to maven-config-p...@googlegroups.com
The encoding in the plugin configuration is "ISO-8859-1", so you need
to save transformation config files and files being processed with
this encoding. After adding:

<?xml version="1.0" encoding="ISO-8859-1" ?>

To the top of client-properties-processing.xml and saving it with this
encoding, the plugin replaced "Tjänsteanteckning" correctly.

2009/8/12 grimsell <grim...@gmail.com>:

grimsell

unread,
Aug 13, 2009, 2:50:16 AM8/13/09
to maven-config-processor-users
Yes, thats right. My mistake.

I have done all the configuration for the project now and its working
fine. Thanks a lot for your help. Its greatly appreciated. :)

I have one little bug left to report but we can work around that for
now so that is of little importance.

We have a property which value is =. Like this:
oaisarchive.maintenance.arithmeticRuleOperatorEqual==

After processing the properties it looks like this:
oaisarchive.maintenance.arithmeticRuleOperatorEqual=


Are your plans still to release 1.8 tomorrow?

On Aug 12, 3:53 pm, Leandro de Oliveira <lehph...@gmail.com> wrote:
> The encoding in the plugin configuration is "ISO-8859-1", so you need
> to save transformation config files and files being processed with
> this encoding. After adding:
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> To the top of client-properties-processing.xml and saving it with this
> encoding, the plugin replaced "Tjänsteanteckning" correctly.
>
> 2009/8/12 grimsell <grims...@gmail.com>:

Leandro de Oliveira

unread,
Aug 13, 2009, 9:35:40 AM8/13/09
to maven-config-p...@googlegroups.com
> After processing the properties it looks like this:
> oaisarchive.maintenance.arithmeticRuleOperatorEqual=

I'll take a look at it.

> Are your plans still to release 1.8 tomorrow?

I'd really like to have a stable release with the new features we
added, but if you think you can catch even more bugs, the new release
can wait. MCP had more bugs than I thought... :)

2009/8/13 grimsell <grim...@gmail.com>:

grimsell

unread,
Aug 13, 2009, 10:19:23 AM8/13/09
to maven-config-processor-users
I agree with you I would also have a stable release for my project to
depend upon so lets release as soon as possible.
It's better to make a bugfix-release on 1.8 later on if necesary, than
to have 1.7 with a major bug as the latest release.

On Aug 13, 3:35 pm, Leandro de Oliveira <lehph...@gmail.com> wrote:
> > After processing the properties it looks like this:
> > oaisarchive.maintenance.arithmeticRuleOperatorEqual=
>
> I'll take a look at it.
>
> > Are your plans still to release 1.8 tomorrow?
>
> I'd really like to have a stable release with the new features we
> added, but if you think you can catch even more bugs, the new release
> can wait. MCP had more bugs than I thought... :)
>
> 2009/8/13 grimsell <grims...@gmail.com>:

Leandro de Oliveira

unread,
Aug 13, 2009, 10:44:40 AM8/13/09
to maven-config-p...@googlegroups.com
>> > After processing the properties it looks like this:
>> > oaisarchive.maintenance.arithmeticRuleOperatorEqual=
>>
>> I'll take a look at it.

I've uploaded a new snapshot fixing this issue, here is the pom.xml:

http://oss.sonatype.org/content/repositories/googlecode-snapshots/com/google/code/maven-config-processor-plugin/maven-config-processor-plugin/1.8-SNAPSHOT/maven-config-processor-plugin-1.8-20090813.144150-5.pom

> I agree with you I would also have a stable release for my project to
> depend upon so lets release as soon as possible.

Yes, let's release ASAP and have a working plugin.

2009/8/13 grimsell <grim...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages