You can also filter the files being included by unpack-dependencies, you can use scope,transitive,groupId,artifactId,type,classifier etc. You should be able to narrow it down to just the ones you want.
Here's the intended distinction between copy/unpack and copy-dependencies/unpack-dependencies: If the thing you want to copy/unpack is already listed as a dependency of your project : use the xxx-dependencies. If it's not, then use copy/unpack. -----Original Message----- From: Matthew Tordoff [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 08, 2008 9:25 AM To: Maven Users List Subject: RE: Downloading artefacts Instead of using the unpack-dependencies goal, try just using the unpack goal, and specify each individual artifact you require ... (I have attached my execution to the validate phase since I require the files I import and unpack as part of later stages of the build). <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>Import and unpack required artifacts</id> <phase>validate</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>group</groupId> <artifactId>artifact</artifactId> <version>version</version> <type>zip</type> <overWrite>true</overWrite> <classifier>assembly identifier</classifier> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> Setting overwrite to true will always replace the local file. Add more artifactItem definitions if you want to import multiple artifacts. For more information regarding this plugin visit: http://maven.apache.org/plugins/maven-dependency-plugin/index.html Regards, Matt -----Original Message----- From: Richard Chamberlain [mailto:[EMAIL PROTECTED] Sent: 08 January 2008 10:52 To: Maven Users List Subject: Downloading artefacts Hi, I'd like to write a script that downloads a number of artefacts stored in a maven repo. The main artefacts are jar files, but I have attached a zip file containing all dependencies, start and stop scripts and configuration files so that i can distribute this to customers. It is the zip that I'm trying to download and unpack to a test environment. Each subsequent time it is run, any snapshots that have been updated would be downloaded and unzipped. I've tried "mvn dependency:unpack-dependencies" but I've had the following issues: - It doesn't delete the old directory when updating (i could do this myself but i don't want to delete directories that won't be updated) - It downloads all transitive dependencies even if they are not going to be unpacked What is the best way to do this in maven? Thanks, Rich The content of this e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient and may not be disclosed, copied or distributed. If you received this email in error, please contact the sender immediately by return e-mail or by telephoning +44 20 7260 2000, delete it and do not disclose its contents to any person. You should take full responsibility for checking this email for viruses. Markit reserves the right to monitor all e-mail communications through its network. Markit and its affiliated companies make no warranty as to the accuracy or completeness of any information contained in this message and hereby exclude any liability of any kind for the information contained herein. Any opinions expressed in this message are those of the author and do not necessarily reflect the opinions of Markit. For full details about Markit, its offerings and legal terms and conditions, please see Markit's website at http://www.markit.com <http://www.markit.com/> . --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
