相关疑难解决方法(0)

使用Maven管理DLL依赖项

我有一个Java程序,Maven管理它的依赖项.其中一个依赖项是另一个程序的JNI包装器.Maven负责处理相关JAR文件的引用,但我自己还在搞乱DLL文件.

有没有一个让Maven处理DLL的好方法?理想情况下,我希望将DLL加载到我们的本地存储库中,如JAR文件.

java dll java-native-interface maven-2

30
推荐指数
1
解决办法
3万
查看次数

使用Maven单个目标在Jar中打包Dll

我在我的maven项目中添加了一个DLL作为依赖,如下所示:

<dependency>
  <groupId>com.test.dll</groupId>
  <artifactId>myDll</artifactId>
  <version>0.1</version>
  <type>dll</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)

当我尝试执行时 maven:install

它给了我这个错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-   
beta-5:single (jar-with-dependencies) on project testApp: Failed to create 
assembly:    Error adding file-set for 'com.test.dll:myDll:dll:0.1' to archive: Error 
 adding archived file-set. PlexusIoResourceCollection not found for: C:\Users\USER\.m2
 \repository\com\test\dll\myDll\0.1\myDll-0.1.dll: No such archiver: 'dll'
Run Code Online (Sandbox Code Playgroud)

我在这做错了什么?

更新

 <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>   
        <executions>
        <execution>
        <goals>
            <goal>sign</goal>
        </goals>
        </execution>
       </executions>
       <configuration>
        <keystore>src/main/keystore/mykey.keystore</keystore>
        <alias>aliasname</alias>
        <storepass>passw0rd</storepass>                  
        <verify>true</verify>

    </configuration>        
    </plugin>               
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>      
        <executions>
            <execution>
                <id>jar-with-dependencies</id>
                <phase>prepare-package</phase>
                <goals>
                    <goal>single</goal>
                </goals>       
            <configuration>
            <archive>
                <manifest>

                </manifest> …
Run Code Online (Sandbox Code Playgroud)

maven-2 maven m2e eclipse-juno

11
推荐指数
2
解决办法
7862
查看次数

标签 统计

maven-2 ×2

dll ×1

eclipse-juno ×1

java ×1

java-native-interface ×1

m2e ×1

maven ×1