[
https://issues.apache.org/jira/browse/MASSEMBLY-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202384#comment-15202384
]
Markus Helm commented on MASSEMBLY-800:
---------------------------------------
Another workaround is to disable the default {{*$\{\*\}*}} delimiter in the
plugin configuration:
{code}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.basedir}/src/assembly/resources.xml</descriptor>
</descriptors>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<attach>false</attach>
<finalName>resources</finalName>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
{code}
Input:
{code}
#!/usr/bin/env bash
B=${A:[email protected]@}
DEFAULT="@maven.default@"
C=${A:-${DEFAULT}}
{code}
Output:
{code}
#!/usr/bin/env bash
B=${A:-Hello World}
DEFAULT="Hello World"
C=${A:-${DEFAULT}}
{code}
> Substitution of variable fields enclosed in ${...} does not work
> ----------------------------------------------------------------
>
> Key: MASSEMBLY-800
> URL: https://issues.apache.org/jira/browse/MASSEMBLY-800
> Project: Maven Assembly Plugin
> Issue Type: Bug
> Components: filtering
> Affects Versions: 2.6
> Reporter: Markus Helm
> Priority: Minor
> Attachments: massembly-reproducer.tar.gz
>
>
> A variable field which is enclosed by {{*$\{...\}*}} does not get substituted
> during filtering. If the same variable field is not enclosed as described,
> the substitution works as expected.
> Before filtering:
> {code}
> #!/usr/bin/env bash
> B=${A:-${maven.default}}
> DEFAULT="${maven.default}"
> C=${A:-${DEFAULT}}
> {code}
> After filtering:
> {code}
> #!/usr/bin/env bash
> B=${A:-${maven.default}}
> DEFAULT="Hello World"
> C=${A:-${DEFAULT}}
> {code}
> The code snippet above also describes a possible workaround by defining a
> variable outside of {{*$\{...\}*}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)