Getting JNotify in Maven / Archiva

I am currently working on a project that involves using JNotify to monitor when a directory / file was created, renamed / modified, and deleted. The project is built on Java 6, not Java 7. JNotify uses JNI to connect to its own OS to monitor the directory / file. My problem is that I need to get JNotify in our repo, but I want it to be built so that java.library.path (DLL) is packed with JNI JAR. How do I do this in Maven?

+3
source share
3 answers

I managed to find the solution I needed using the following maven plugin: http://code.google.com/p/mavennatives/

+1
source

, , archiva.

0

The repository format is fixed, so after extracting the artifact, you will need to rename it. It depends on how you are going to use it after its restoration.

This is a generic template, something like this:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <configuration>
    <stripVersion>true</stripVersion>
  </configuration>
  <executions>
    <execution>
      <id>copy-jnotify</id>
      <configuration>
        <includeArtifactIds>JNotify</includeArtifactIds>
        <outputDirectory>${project.build.directory}/my-app</outputDirectory>
      </configuration>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
    </execution>
  </executions>
</plugin>

You can use this with the appropriate list of artifacts to be copied to the directory target/my-app

0
source

All Articles