我做了类似的事情,但我将本机库打包在 zip 文件中。之后,在需要它们的工件中,我使用maven 依赖插件提取并解压缩zip 文件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unzip</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0.0</version>
<type>zip</type>
<overWrite>true</overWrite>
<includes>**/*.dll</includes>
<outputDirectory>${project.build.directory}/natives</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
如您所见,我不使用任何分类器。