Content is not allowed in prolog.

170 views
Skip to first unread message

Gabriel Bermudez

unread,
Nov 26, 2012, 4:07:36 PM11/26/12
to maven-config-p...@googlegroups.com
Hi,

I can't seem to get rid of these message no matter what I do.  I have the following original config file:

<?xml version="1.0" encoding="UTF-8"?>
<qbean>
    <attr>1</attr>
</qbean>

And the following processor configuration

<?xml version="1.0" encoding="UTF-8"?>
<processor>
    <modify>
        <name>//qbean/attr</name>
        <value>100</value>
    </modify>
</processor>

So what want to achive is the following file

<?xml version="1.0" encoding="UTF-8"?>
<qbean>
    <attr>100</attr>
</qbean>

But for some reason I always get is "Content is not allowed in prolog." The configuration of the plugin is as follows

<plugin>
                    <groupId>com.google.code.maven-config-processor-plugin</groupId>
                    <artifactId>maven-config-processor-plugin</artifactId>
                    <version>2.2</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>process</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <transformations>
                            <transformation>
                                <type>xml</type>
                                <input>src/main/resources/config-proc/switch.xml</input>
                                <output>src/main/resources/deploy/switch.xml</output>
                                <config>src/main/resources/config-proc/switch-todofacil.xml</config>
                            </transformation>
                        </transformations>
                    </configuration>
                </plugin>

Do anyone knows what I'm missing. Thanks for you help.

Regards,

Leandro de Oliveira

unread,
Nov 26, 2012, 5:31:32 PM11/26/12
to maven-config-p...@googlegroups.com
Hi,

It may be the issue described at [1] or [2]. Can you please attach the exact xml files you're using and the complete stacktrace?

Gabriel Bermudez

unread,
Nov 27, 2012, 11:21:50 AM11/27/12
to maven-config-p...@googlegroups.com
Hi Leandro,

Thanks for your answer. I'm attaching the whole project but I can't get the full stack trace. What I get is the following error:

[INFO] Processing file [src/main/resources/deploy/switch.xml] using config [src/main/resources/cfg-proc/switch-test.xml], outputing to [/home/gabriel/devel/workspace/cfg-proc/target/cfg-proc-1.0.0-SNAPSHOT/deploy/switch.xml]
[Fatal Error] :1:1: Content is not allowed in prolog.

The error should be reproducible by extracting the file and running

mvn -X -Ptest clean com.google.code.maven-config-processor-plugin:maven-config-processor-plugin:process

Thanks for your help again.

Regards,
cfg-proc.zip

Leandro de Oliveira

unread,
Nov 28, 2012, 8:11:32 PM11/28/12
to maven-config-p...@googlegroups.com
Ok,

The plugin assumes an XML value for modify actions, so the following
will do what you want:

<modify>
<name>/qbean/attr</name>
<value>
<![CDATA[
<attr>100</attr>
]]>
</value>
</modify>

You can also use find/replace like this:

<modify>
<find>1</find>
<replace>100</replace>
</modify>

I've created issue 40 to implement a way to make this kind of
modification almost like what you've configured initially.

Thanks for spotting that.

2012/11/27 Gabriel Bermudez <elga...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "maven-config-processor-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/maven-config-processor-users/-/qtovJf6sVWEJ.
>
> To post to this group, send email to
> maven-config-p...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-config-process...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-config-processor-users?hl=en.

Gabriel Bermudez

unread,
Nov 29, 2012, 4:57:14 PM11/29/12
to maven-config-p...@googlegroups.com
Hi Leandro,

I tried the change and works like a charm.  Thanks for you help and I look forward to the new feature.

Best Regards,
> maven-config-processor-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages