[
https://jira.codehaus.org/browse/MNG-3558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=359603#comment-359603
]
Christophe DENEUX edited comment on MNG-3558 at 12/24/14 4:05 AM:
------------------------------------------------------------------
I re-open this issue that exists also with Maven 3.1.1.
With the following POM, I try to get the following output without success:
{{My property placeholder: $\{my-prop}}}
This is the goal of this issue.
{code:xml}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.ow2.petals</groupId>
<artifactId>foo</artifactId>
<version>0-SNAPSHOT</version>
<properties>
<my-prop>3.4-SNAPSHOT</my-prop>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>My property value: ${my-prop}</echo>
<echo>How to print my property placeholder #1 (not
working): $${my-prop}</echo>
<echo>How to print my property placeholder #2 (not
working): ${dollar}{my-prop}</echo>
<echo>How to print my property placeholder #3 (not
working): \${my-prop}</echo>
<echo>How to print my property placeholder #4 (not
working): <![CDATA[${my-prop}]]></echo>
<!--
<echo>My property placeholder: 'how to print the right
result that is "${my-prop}"</echo>
-->
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
was (Author: cdeneux):
I re-open this issue that exists also with Maven 3.1.1.
With the following POM, I try to get the following output without success:
{{My property placeholder: $\{my-prop}}}
This is the goal of this issue.
{code:xml}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.ow2.petals</groupId>
<artifactId>foo</artifactId>
<version>0-SNAPSHOT</version>
<properties>
<my-prop>3.4-SNAPSHOT</my-prop>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>My property value: ${my-prop}</echo>
<echo>How to print my property placeholder #1 (not
working): $${my-prop}</echo>
<echo>How to print my property placeholder #2 (not
working): ${dollar}{my-prop}</echo>
<echo>How to print my property placeholder #3 (not
working): \${my-prop}</echo>
<echo>How to print my property placeholder #4 (not
working): <![CDATA[${my-prop}]]></echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
> Add a property substitution escaping mechanism
> ----------------------------------------------
>
> Key: MNG-3558
> URL: https://jira.codehaus.org/browse/MNG-3558
> Project: Maven
> Issue Type: Bug
> Components: General
> Affects Versions: 2.0.9, 3.1.1
> Reporter: Christophe DENEUX
>
> Hi,
> Developping a maven plugin, it is possible to initialize plugin parameters to
> "$\{artifactId}-$\{version}" without property substitution, using:
> {{@parameter expression="$$\{artifactId}-$$\{version}.$$\{extension}"}}
> at the parameter declaration.
> But, in a POM file, it seems to me that it is not possible to redefine the
> value of a such parameter without property substitution.
> I had tried without success:
> * <parameter>$\{dollar}\{artifactId}</parameter> with the property "dollar"
> set to "$", replaced by value of artifactId,
> * <parameter>$$\{artifactId}</parameter>, replaced by "$" followed by
> artifactId value,
> * <parameter>\$\{artifactId}</parameter>, replaced by "\" followed by
> artifactId value,
> * <parameter><!\[CDATA\[$\{artifactId}]]></parameter>, replaced by value of
> artifactId.
> Please, add a property substitution escaping mechanism.
> Thanks,
> Christophe
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)