hi,

All mojo parameters are evaluated, nothing you can do about that.

But as with all 'templating' or evaluation solutions, you can escape characters
with special meanings in mojo parameters. Just replace $ with $$.

So use this, and you'll get 'println "${basedir}"' injected
as a mojo parameter:

                <source>
                    println "$${basedir}"
                </source>

-- Kenney

Jason Dillon wrote:
Hey, is there anyway to get a specific mojo parameters value passed in *completely* unfiltered or evaluated with the default property expansion?

I'd like to get the XML contents *exactly* how they are in the pom.xml file... so for example in this plugin configuration:

----8<----
<plugin>
    <groupId>org.codehaus.mojo.groovy</groupId>
    <artifactId>groovy-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <source>
                    println "${basedir}"
                </source>
            </configuration>
        </execution>
    </executions>
</plugin>
---->8----

I really, really, *really* want to have the "source" parameter injected as 'println "${basedir}"' and not have Maven expand ${basedir} at all.

For most params I want Maven to do this, but for this one specific param... I really need it to leave it alone. As right now its causing problems for windows users when they reference properties in GStrings.

So on windows, evil *ucking platform, Maven passes in something more like 'println "c:\cygwin\home\jason\tmp\test-project"', which... um isn't going to work, since my use-case here is to pass that parameter into a Groovy shell for execution... and Groovy will puke up complaining about \c, \h, \j, or \<anything> that isn't a real escape sequence... and even if they are all valid, I don't want it to do that... don't need tabs or newlines or whatever in there.

I tried creating a custom converted, based on what I saw in the antrun plugin:

https://svn.codehaus.org/mojo/trunk/mojo/groovy/groovy-maven-plugin/src/main/java/org/codehaus/mojo/groovy/CodeSourceConverter.java

But it looks like that PlexusConfiguration.getValue() does not return the raw xml from the pom, but has already been through some filtering muck.

So... is there anyway to get the *exact*... untouched, asis, whatever the user put there, contents of a mojo configuration element?

Any ideas or suggestions would be very helpful at this point... I'm running out of ideas.

:-(

Thanks,

--jason

---------------------------------------------------------------------
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]

Reply via email to