Skip to content

Instantly share code, notes, and snippets.

@jpassaro
Created December 21, 2018 17:06
Show Gist options
  • Save jpassaro/0892106beca2a066fae21320be41dcbf to your computer and use it in GitHub Desktop.
Save jpassaro/0892106beca2a066fae21320be41dcbf to your computer and use it in GitHub Desktop.
Strange behavior of assembly
<assembly>
<id>assembly</id>
<formats>
<format>dir</format>
</formats>
<files>
<file>
<source>content.txt</source>
<outputDirectory>/</outputDirectory>
<destName>filtered-content.txt</destName>
<filtered>true</filtered>
</file>
</files>
</assembly>
some unfiltered text
foo expands to '${params.foo}'
bar expands to '${params.bar}'
"..." expands to '${...}'
"…" expands to '${…}'
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>net.jsharp</groupId>
<artifactId>assembly-example</artifactId>
<version>1</version>
<packaging>pom</packaging>
<properties>
<params.foo>FOO</params.foo>
<params.bar>BAR</params.bar>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptors>
<descriptor>${project.basedir}/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
@jpassaro
Copy link
Author

Unexpected output:

$ cat target/assembly-example-1-assembly/assembly-example-1/filtered-content.txt
some unfiltered text
foo expands to 'FOO'
bar expands to 'BAR'
"..." expands to 'MavenProject: net.jsharp:assembly-example:1 @ /path/to/my/code/pom.xml'
"…" expands to '${…}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment