maven


copy folder contents using maven's unpack-dependency


I have a zip which i have defined in my dependencies as shown below
<dependency>
<groupId>com.project.mine</groupId>
<artifactId>${projectname}</artifactId>
<version>${projectversion}</version>
<classifier>bin</classifier>
<type>zip</type>
</dependency>
This zip contains two folders namely
Folder 1
Folder 2
I am trying to copy the content of this zip as shown below
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-one</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.project.mine</includeGroupIds>
<includeArtifactIds>projectone</includeArtifactIds>
<type>zip</type>
<outputDirectory>${target.assets}/www</outputDirectory>
</configuration>
</execution>
<execution>
<id>unpack-two</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.project.mine</includeGroupIds>
<includeArtifactIds>${projectname}</includeArtifactIds>
<type>zip</type>
<outputDirectory>${target.assets}/www/ProjectOneContent</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
The problem that i face is that it copies both the folders.
I want to just copy the contents of 'Folder2' (which can be subfolders, images, js, css etc) inside 'ProjectOneContent' folder.
Note: ProjectOneContent is created after first execution is completed
Well, from what I can see, you are not defining any includes patterns (as explained here). Add the following to your <configuration>:
<includes>Folder2/**</includes>
I achieved it using maven-antrun plugin.
To achieve this first i unpack dependency at a temporary location and then once unpacked, i copied each resource one by one using antrun at desired location

Related Links

Run TestNG single test from one Group
TinyRadius maven repository
Dependency downloaded from Maven Central is free from Malware?
How to use the same target platform multiple sub-projects in Tycho
Maven Grails web.xml
Can I make a Maven profile add webResources to a war and still add non-profiled webResources?
HTTP Status 409 - The target deployment path […] does not match the POM's expected path prefix
Maven command to go back to previous day snapshot
Maven site on multi module project could not resolve dependency
Glassfish Maven Deploy Plugin - Deployment Failure
zmq failed when running unit test in Intellij IDEA with Maven
How Can I Distribute Jetty With My WAR Using Maven?
Referencing the Maven dependencies in antrun plugin
eclipse comands.jar 3.3.0 dependency not found
Hot deploy on Glassfish at Netbeans
Maven compilation failure but dependencies exist

Categories

HOME
ms-access
google-chrome-extension
netbeans
amazon-ec2
keras
heroku
json.net
jsrender
basic
windows-10-universal
wheelnav.js
postgres-xl
vb.net-2010
static-libraries
orchardcms
visual-studio-cordova
quickfix
try-catch
vaadin7
reactive-cocoa
lucene.net
karma-jasmine
jtextfield
predix
custom-wordpress-pages
object-detection
orleans
dcevm
excel-2007
restful-authentication
pepper
fgetcsv
libssl
newline
airconsole
scorm2004
code-contracts
restlet
automake
temporary-files
http-live-streaming
.net-4.6.2
qcombobox
logfiles
osx-mavericks
zip4j
theming
worksheet
typescript1.8
powercli
worker-thread
time-and-attendance
home-directory
trash
connect-by
react-native-listview
reactive-banana
collapse
python-3.2
angular-leaflet-directive
sortedlist
mmc
npapi
website-monitoring
typekit
googlemock
bitcoinj
terminfo
ceil
has-many-through
navigationservice
dealloc
transcoding
centos5
stxxl
viadeo
quartz-graphics
ftps
shellexecute
padarn
django-nonrel
xamlparseexception
tinn-r
itmstransporter
broken-links
runas
qtkit
transactionscope
coredump
yetanotherforum
self-extracting
propagation
lpeg
dentrix
jquery-ui-droppable
ctp4
gacutil
defensive-programming
genealogy
windows-live-messenger

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App