问题大概描述:不知道什么原因导致jar包一直识别不成功,调用不到jar包里面的方法.
总结:可能是复制了几次之后jar损坏的,这点也可以通过jar包大小来比对
摆放的位置:
这个命令springboot打包可以把本地的scode为system的包打到最终的包里
总结:
<dependency>
<groupId>com.my</groupId>
<artifactId>jni-test</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jna.jar</systemPath>
</dependency>
这个方式可以把本地的jar 导入maven中管理 project.basedir就是pom的同级目录
备注:不要放在resource下面那种 就放在项目下lib 然后通过这种方式引入
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
这个命令springboot打包可以把本地的scode为system的包打到最终的包里
非springboot项目的话可以关注下这个
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/libs</extdirs>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>