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)

<component-set>
  <components>    
    <!-- UnArchiver -->  
    <component>
      <role>org.codehaus.plexus.archiver.UnArchiver</role>
      <role-hint>nar</role-hint>
      <!-- there is no implementaion of SWCUnArchiver, but ZipUnArchive
will do the job -->
 
<implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver</implemen
tation>
      <instantiation-strategy>per-lookup</instantiation-strategy>
    </component>          
  </components>
</component-set>

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/1208965980000.html

-----Original Message-----
From: RalphWH [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 13, 2008 8:22 PM
To: [email protected]
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:
                        <plugin>
                          <groupId>org.freehep</groupId>
                          <artifactId>freehep-nar-plugin</artifactId>
                          <executions>
                            <execution>
                               <id>download-nar</id>
                               <phase>package</phase>
                               <goals>
                                 <goal>nar-download</goal>
                                 <goal>nar-unpack</goal>
                               </goals>
                            </execution>
                          </executions>
                        </plugin>

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 <dependency> tag directly with
<type>nar</type>, 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]

Reply via email to