Hi want some files that are inside a jar copied to the root folder of my java project.
I used this :
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.4.1</version>
<type>jar</type>
<includes>win32-x86/*.dll</includes>
<overWrite>true</overWrite>
<outputDirectory>${basedir}</outputDirectory> <!-- project root directory -->
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
problem is I get this
javaProject
src
target
win32-x86/dll1.dll
win32-x86/dll2.dll
I want to get this
javaProject
src
target
dll1.dll
dll2.dll
I don't want the folder path from inside the jar to be reproduced, I just want the files dumped in my project's root.
Any ideas?
Thanks.
You can use the Jetspeed unpack maven plugin: http://pulkitsinghal.blogspot.be/2011/04/jetspeed-finally-unpack-plugin-with.html
See http://portals.apache.org/jetspeed-2/buildguide/jetspeed-unpack-plugin.html for documentation.
The option you want is :
<flat>true</flat>
Full example:
<plugin>
<groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>jetspeed-unpack-maven-plugin</artifactId>
<version>${org.apache.portals.jetspeed.version}</version>
<configuration>
<unpack>
<artifact>...</artifact>
<file>...</file>
<targetDirectory>...</targetDirectory>
<overwrite>...</overwrite>
<resources combine.children="append">
<resource>
<path>...</path>
<destination>...</destination>
<overwrite>...</overwrite>
<flat>...</flat>
<include>...</include>
<exclude>...</exclude>
<name>...</name>
</resource>
...
</resources>
</unpack>
<skip>...</skip>
<verbose>...</verbose>
</configuration>
</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