Re: How to copy unpacked nar file contents into target directory?
Thanks guys! I think I finally got something together that works: The in pom.xml of the project you want to assemble with the nar .so libraries: ... org.freehep freehep-nar-plugin narSpLauncher download-a-nar package nar-assembly maven-assembly-plugin /src/main/assembly/narSpLauncher.xml ... /src/main/assembly/narSpLauncher.xml sp zip true ${user.dir}/target/nar/lib/${os.arch}-${os.name}-g++/shared lib **/*.so <...add whatever other files you want to include...> So basically, freehep-nar-plugin's goal 'nar-assembly' will copy the contents of the nar file into the /target directory and the maven-assembly-plugin is used to create the assembled file. The freehep-nar-plugin does have a couple of quirks and that is why the ${user.dir} is used in the assembly.fileSets (see: http://bugs.freehep.org/browse/NARPLUGIN-171 NARPLUGIN-171 ) Thanks again! RalphWH wrote: > > Hello All, > > I have a project that is packaging into a jar and is using the > freehep-nar-plugin to download and unpack the needed .nar files. This part > works great. But what I haven't been able to figure out is how to then > copy the .so files (in the .nar downloaded files) into the packaged .jar > or into the assembly component .zip files. Since the nar files are > downloaded and unpacked in the repository, how can I go about copying them > into the target/ directory? > > This is the download and unpack snippet: > > org.freehep > freehep-nar-plugin > > >download-nar >package > > nar-download > nar-unpack > > > > > > I have tried setting the targetDirectory tag in configuration, but this is > ignored by the unpack goal. I have also tried to use the > maven-dependency-plugin, but this seems to ignore nar files completely. > > I've also tried to use mvn's tag directly with > nar, but this doesn't work because the nar file that it tries > to download doesn't include the ${aol} (ex: > ${file_name}-i386-Linux-g++-shared.nar). It just attached .nar to the end > of the artifactId. > > It seems like I'm missing something obvious here but I haven't been able > to figure it out. Any ideas would be greatly appreciated. Thanks! > -- View this message in context: http://www.nabble.com/How-to-copy-unpacked-nar-file-contents-into-target-directory--tp17834192p18205829.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to copy unpacked nar file contents into target directory?
Hi Ralph, RalphWH wrote: > Hello All, > > I have a project that is packaging into a jar and is using the > freehep-nar-plugin to download and unpack the needed .nar > files. This part > works great. But what I haven't been able to figure out is > how to then copy > the .so files (in the .nar downloaded files) into the > packaged .jar or into > the assembly component .zip files. Since the nar files are downloaded > and unpacked in the repository, how can I go about copying them > into the target/ > directory? > > This is the download and unpack snippet: > > org.freehep > freehep-nar-plugin > > >download-nar >package > > nar-download > nar-unpack Add the nar-assebmly goal also: nar-assembly > > > And configure here which version you'd like to access: x86-Windows-msvc-DUMMY Note, that the DUMMY part might not be necessary for newer versions of the plugin. For some reason, we're still using a quite old one. > > > I have tried setting the targetDirectory tag in > configuration, but this is > ignored by the unpack goal. I have also tried to use the > maven-dependency-plugin, but this seems to ignore nar files > completely. > > I've also tried to use mvn's tag directly with > nar, but this doesn't work because the nar file > that it tries > to download doesn't include the ${aol} (ex: > ${file_name}-i386-Linux-g++-shared.nar). It just attached .nar to the > end of the artifactId. > > It seems like I'm missing something obvious here but I > haven't been able to > figure it out. Any ideas would be greatly appreciated. Thanks! Some words of warnign though: While the NAR-plugin is a great solution for the complete native stuff, it is quite not possible to get in contact with anyone of the devs. The only communication offer the NAR-plugin people are doing is a forum where no-one answers. So you're completely on your own for any kind of support and you might better have a look at the native plugin from Maven's Mojo project. - Jörg BTW: The plugin is has another bug, since it will extract the content of the nar plugin always into the target directory of the project where the build has been started i.e. it will put the files into the wrong directory for multi-module builds! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to copy unpacked nar file contents into target directory?
Like this: org.apache.maven.plugins maven-dependency-plugin narUnArchiver narUnArchiver 0.1 unpack package unpack - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to copy unpacked nar file contents into target directory?
Thanks for your help Brian. I'm afriad I'm not quite following your suggestion though. If I add the narUnArchiver dependency to the maven-dependency-plugin like so: org.freehep freehep-nar-plugin download-a-nar package nar-download nar-unpack org.apache.maven.plugins maven-dependency-plugin unpack package unpack narUnArchiver narUnArchiver 0.1 This results in the file component.xml (from narUnArchiver.jar) being unpacked in the target directory. I don't think this the desired result. What am I missing here? Thanks! Brian E Fox wrote: > >>I then added the dependency tags as described in your blog post as > follows: > > > > You need to add the dependency to the maven-dependency-plugin unpack > execution > > > --Brian > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-copy-unpacked-nar-file-contents-into-target-directory--tp17834192p17957042.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to copy unpacked nar file contents into target directory?
>I then added the dependency tags as described in your blog post as follows: You need to add the dependency to the maven-dependency-plugin unpack execution --Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to copy unpacked nar file contents into target directory?
Thank you for your reply. I have tried to get your solution working, but I have not quite succeeded. To answer your assumption first: > I'm assuming the nar is just a zip like jars and wars. Yes, this is true. This is what I've done: I created a new jar with the components.xml file containing your component-set tags in the specified directory path. I used maven to create and install the jar and ended up with a jar called: narUnArchiver-0.1.jar I then added the dependency tags as described in your blog post as follows: ... org.freehep freehep-nar-plugin download-a-nar package nar-download nar-unpack narUnArchiver narUnArchiver 0.1 ... This builds successfully, but the contents of the nar files are not included in the target directory. I also tried your other idea of adding it in the build extension: ... narUnArchiver narUnArchiver 0.1 ... With the build extension (above) I get a build error: [ERROR] BUILD ERROR [INFO] [INFO] Internal error in the plugin manager executing goal 'org.freehep:freehep-nar-plugin:2.0-alpha-11-SNAPSHOT:nar-unpack': Unable to find the mojo 'org.freehep:freehep-nar-plugin:2.0-alpha-11-SNAPSHOT:nar-unpack' in the plugin 'org.freehep:freehep-nar-plugin' org.codehaus.plexus.archiver.zip.ZipUnArchiver ... Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.zip.ZipUnArchiver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) So I believe the error is caused by the library not being found, but it is in the repository and I've tried including it as a project.dependency and as build.extensions.extension but to no avail. Any ideas as to what I am missing here? Thanks for your time and help! Brian E Fox wrote: > > I'm assuming the nar is just a zip like jars and wars. If so, you just > need to map nar to the correct unarchiver and the dependency plugin will > be able to unpack it. > > Add the following to a jar in META-INF/plexus/components.xml (or just > drop into src/main/resources/META-INF/plexus/components.xml of a new jar > project and let maven pack it for you) > > > > > > org.codehaus.plexus.archiver.UnArchiver > nar > > > org.codehaus.plexus.archiver.zip.ZipUnArchiver tation> > per-lookup > > > > > Then add this jar to a dependency section inside the plugin config (as > shown in [1]) if that doesn't work, then add it as a build extension. If > you confirm this works, I'll add it to the dependency plugin ( I already > have added support for SWC this way). > > --Brian > > [1] http://blogs.sonatype.com/brian/2008/04/23/120896598.html > > -Original Message- > From: RalphWH [mailto:[EMAIL PROTECTED] > Sent: Friday, June 13, 2008 8:22 PM > To: users@maven.apache.org > Subject: How to copy unpacked nar file contents into target directory? > > > Hello All, > > I have a project that is packaging into a jar and is using the > freehep-nar-plugin to download and unpack the needed .nar files. This > part > works great. But what I haven't been able to figure out is how to then > copy > the .so files (in the .nar downloaded files) into the packaged .jar or > into > the assembly component .zip files. Since the nar files are downloaded > and > unpacked in the repository, how can I go about copying them into the > target/ > directory? > > This is the download and unpack snippet: > > org.freehep > freehep-nar-plugin > > >download-nar >package > > nar-download > nar-unpack > > > > > > I have tried setting the targetDirectory tag in configuration, but this > is > ignored by the unpack goal. I have also tried to use the > maven-dependency-plugin, but this seems to ignore nar files completely. > > I've also tried to use mvn's tag directly with > nar, but this doesn't work because the nar file that it > tries > to download doesn't include the ${aol} (ex: > ${file_name}-i386-Linux-g++-shared.n
RE: How to copy unpacked nar file contents into target directory?
I'm assuming the nar is just a zip like jars and wars. If so, you just need to map nar to the correct unarchiver and the dependency plugin will be able to unpack it. Add the following to a jar in META-INF/plexus/components.xml (or just drop into src/main/resources/META-INF/plexus/components.xml of a new jar project and let maven pack it for you) org.codehaus.plexus.archiver.UnArchiver nar org.codehaus.plexus.archiver.zip.ZipUnArchiver per-lookup Then add this jar to a dependency section inside the plugin config (as shown in [1]) if that doesn't work, then add it as a build extension. If you confirm this works, I'll add it to the dependency plugin ( I already have added support for SWC this way). --Brian [1] http://blogs.sonatype.com/brian/2008/04/23/120896598.html -Original Message- From: RalphWH [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2008 8:22 PM To: users@maven.apache.org Subject: How to copy unpacked nar file contents into target directory? Hello All, I have a project that is packaging into a jar and is using the freehep-nar-plugin to download and unpack the needed .nar files. This part works great. But what I haven't been able to figure out is how to then copy the .so files (in the .nar downloaded files) into the packaged .jar or into the assembly component .zip files. Since the nar files are downloaded and unpacked in the repository, how can I go about copying them into the target/ directory? This is the download and unpack snippet: org.freehep freehep-nar-plugin download-nar package nar-download nar-unpack I have tried setting the targetDirectory tag in configuration, but this is ignored by the unpack goal. I have also tried to use the maven-dependency-plugin, but this seems to ignore nar files completely. I've also tried to use mvn's tag directly with nar, but this doesn't work because the nar file that it tries to download doesn't include the ${aol} (ex: ${file_name}-i386-Linux-g++-shared.nar). It just attached .nar to the end of the artifactId. It seems like I'm missing something obvious here but I haven't been able to figure it out. Any ideas would be greatly appreciated. Thanks! -- View this message in context: http://www.nabble.com/How-to-copy-unpacked-nar-file-contents-into-target -directory--tp17834192p17834192.html Sent from the Maven - Users mailing list archive at Nabble.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]