How to reference the native dll from Maven repo?

If the JAR is accompanied by a native DLL in the Maven repo, what do I need to put in my pom.xml to get this DLL in the package?

To be more specific, take, for example, the Jacob library. How to make jacob-1.14.3-x64.dllgo to folder WEB-INF/libafter launch mvn package?

In our local Nexus repository, we got these definitions for JAR and DLL:

<dependency>
  <groupId>net.sf.jacob-project</groupId>
  <artifactId>jacob</artifactId>
  <version>1.16-M2</version>
</dependency>

<dependency>
  <groupId>net.sf.jacob-project</groupId>
  <artifactId>jacob</artifactId>
  <version>1.16-M2</version>
  <classifier>x64</classifier>
  <type>dll</type>
</dependency>

But including the same dependencies in our POM project and starting it mvn packagedoesn't cause the DLL to go to WEB-INF/lib, but the JAR gets everything in order.

What are we doing wrong?

+5
source share
2 answers

For a DLL, you will need to use Copy MOJO Dependencies .

, DLL, , , target/webapp/WEB-INF/lib.

+6

Monty0018 . maven, :

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <executions>
        <execution>
          <id>copy-dependencies</id>
          <phase>prepare-package</phase>
          <goals>
            <goal>copy-dependencies</goal>
          </goals>
          <configuration>
            <excludeTransitive>true</excludeTransitive>
            <includeArtifactIds>jacob</includeArtifactIds>
            <failOnMissingClassifierArtifact>true</failOnMissingClassifierArtifact>
            <silent>false</silent>
            <outputDirectory>target/APPNAME/WEB-INF/lib</outputDirectory>
            <overWriteReleases>true</overWriteReleases>
            <overWriteSnapshots>true</overWriteSnapshots>
            <overWriteIfNewer>true</overWriteIfNewer>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
 </build>
+8

All Articles