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

Maven Goal(s) Failing to Execute
Maven - dynamically creating a map, and referring to it
How to create Maven Jar file when tests contain JUnit #Test annotations and no main class
How to determine when cmds in docker exec complete
Only 1 test class is running and TestNG execution hangs
Zip file empty using maven assembly plugin in pom
Jenkins deploying artifacts to Artifactory. maven-metadata.xml shows incorrect version for release and does not show versions for snapshot
How to restore artifacts in Jenkins multibranch job?
How to get the currently processed dependencys artefactid during process-resources
how do I get maven to tell me what jar it would build without building it?
1.0.0-SNAPSHOT in two Nexus repositories of one group
Failure to find org.jenkins-ci.plugins:plugin:pom:2.11 in https://repo.maven.apache.org/maven2
Cobertura wrong coverage reporting issues
Configuration of Maven profile to connect with SonarQube which is using LDAP
docker, maven start failed: Connection is still allocated
Build Failure while while building the Apache Zeppelin

Categories

HOME
xamarin
multithreading
debugging
reflection
pycharm
angular-material
smarty
relay
webstorm
rubygems
v8
synchronization
qt-creator
jsprit
vaadin7
django-simple-history
oxyplot
openedx
dbext
immutable.js
functional-testing
language-agnostic
claims-based-identity
firebase-crash-reporting
qhull
fish
traffic
fifo
publish
tasklet
srcset
preg-match-all
fog
noraui
avcapturesession
android-kernel
cloud-code
mapdb
catalog
jmonkeyengine
restlet
neuroscience
mixture-model
starteam
sqlite2
unobtrusive-validation
temporary-files
botbuilder
cubic-spline
dds
logparser
worksheet
boost-multi-index
fancybox-2
nativeapplication
slickedit
kbuild
feeds
libusb-win32
np-complete
arrow-keys
jspdf-autotable
django-scheduler
messenger
parallel-data-warehouse
medium.com
visual-c++-2008
android-fonts
nxt
phishing
gridview-sorting
design-by-contract
srand
intel-fortran
python-3.2
coveralls
composite
e10s
nsmutabledictionary
fscommand
angularjs-ng-click
cdt
file-copying
googlemock
google-reader
openexr
has-many-through
article
message-driven-bean
ccss
sitemesh
hungarian-algorithm
bluepill
automount
multipage
newtonscript
hosts-file
wse3.0
buildr
cufon
spyware
external-accessory
infobox
site.master
ext3
sef
temporal-database
post-build
multiple-languages
ajax-forms

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