Thanks very much. I'll see how this approach works for my project.

On Mar 6, 2009 2:56 AM, "Jörg Schaible" <[email protected]> wrote:

Hi John,

John Bito wrote at Donnerstag, 5. März 2009 22:50:

> I'm interested in Jörg's experience. In the documentation, it appears >
that the NAR project art...
we use it either to build a shared DLL (from C or C++ code) that is used as
a plugin for a non-Java application or to create JNI DLLs. One module is
used to create the shard library, in another module we unpack the nar and
create a ZIP (using the assembly plugin, but you might have used also
something like nsis-plugin/izpack-plugin to create an installer).

Settings in the Global POM, that is inherited everywhere:

 <build>
   <pluginManagement>
     <plugins>
       <plugin>
               <groupId>org.freehep</groupId>
               <artifactId>freehep-nar-plugin</artifactId>
               <version>2.0-alpha-10</version>
               <extensions>true</extensions>
               <configuration>

 <targetDirectory>${project.build.directory}/nar</targetDirectory>
               </configuration>
       </plugin>
       ...
     </plugins>
   </pluginManagement>
   ...
 </build>
 <dependencyManagement>
   <dependencies>
       <dependency>
               <groupId>my.group</groupId>
               <artifactId>simple-plugin</artifactId>
               <version>1.0-SNAPSHOT</version>
       </dependency>
   </dependencies>
 </dependencyManagement>



In the POM that builds the shard lib:

       <groupId>my.group</groupId>
       <artifactId>simple-plugin</artifactId>
       <packaging>nar</packaging>
       <version>1.0-SNAPSHOT</version>
       ....
       <build>
               <sourceDirectory>src/main/cpp</sourceDirectory>
               <plugins>
                       <plugin>
                               <groupId>org.freehep</groupId>
                               <artifactId>freehep-nar-plugin</artifactId>
                               <configuration>
                                       <runtime>static</runtime>
                                       <linker>
                                               <name>msvc</name>
                                       </linker>
                                       <libraries>
                                               <library>
                                                       <type>shared</type>
                                               </library>
                                       </libraries>
                                       <cpp>
                                               <defines>

 <define>SIMPLEPROVIDER_EXPORTS</define>
                                               </defines>
                                               <optimize>speed</optimize>
                                       </cpp>
                               </configuration>
                       </plugin>
               </plugins>
       </build>



In that creates the assembly:

       <build>
               <plugins>
                       <plugin>

 <artifactId>maven-assembly-plugin</artifactId>
                               ...
                       </plugin>
                       <plugin>
                               <groupId>org.freehep</groupId>
                               <artifactId>freehep-nar-plugin</artifactId>
                               <executions>
                                       <execution>
                                               <goals>

 <goal>nar-download</goal>

 <goal>nar-unpack</goal>

 <goal>nar-assembly</goal>
                                               </goals>
                                       </execution>
                               </executions>
                               <configuration>
                                       <classifiers>

 <classifier>x86-Windows-msvc-shared</classifier>
                                       </classifiers>
                               </configuration>
                       </plugin>
               </plugins>
       </build>

       <dependencies>
               <dependency>
                       <groupId>my.group</groupId>
                       <artifactId>simple-plugin</artifactId>
               </dependency>
               ...
       </dependencies>

Hope this helps,

Jörg ---------------------------------------------------------------------
To unsubscribe from thi...

Reply via email to