According to the maven assembly plugin docs, relative directories are allowed, but ".." doesn't seem to work at all.
For reasons I cannot go into (and I cannot change), there are some files outside of the maven project directory I want to include in the assembly.
/-
---maven-project/
---some-crap/
I have tried various things:
<fileSets>
<fileSet>
<directory>${project.basedir}/../some-crap</directory>
<outputDirectory>crapdir</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileset>
or
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>crapdir</outputDirectory>
<includes>
<include>../some-crap/**/*</include>
</includes>
</fileSet>
</fileset>
or
<fileSets>
<fileSet>
<directory>../some-crap</directory>
<outputDirectory>crapdir</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileset>
etc. My maven version is 3.0.4 (latest)
Outside of writing something in ant to fetch this stuff or copying it to my target dir before assembling, is there anything I can do?
I really think the assembly plugin is treating ".." as a directory name and not "go up one level".
Thanks.
How about using maven-antrun-plugin to copy files to your project dir before assembling?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>prepare-deploy-package</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${project.build.directory}">
<fileset dir="../xxxx">
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With