使用 Maven 程序集插件将 rxtx 库打包到 jar 中
我需要创建一个具有依赖项的 jar 文件,并且需要添加 rxtx 库作为依赖项。但是当我创建 jar 时,我在 jar 文件中看不到 rxtx 。请向我发布执行此操作的正确方法。
这是我的 pom 文件的相关部分
....
<dependency>
<groupId>org.rxtx</groupId>
<artifactId>rxtxcomm</artifactId>
<version>2.0-7pre1</version>
<scope>run</scope>
</dependency>
....
....
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>uom.elect.smeter.Output</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
....
i need to create a jar file with dependencies and i need to add rxtx library as a dependency. but when i create the jar i cannot see rxtx in the jar file. please post me the correct way to do this.
this is my relevant part of the pom file
....
<dependency>
<groupId>org.rxtx</groupId>
<artifactId>rxtxcomm</artifactId>
<version>2.0-7pre1</version>
<scope>run</scope>
</dependency>
....
....
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>uom.elect.smeter.Output</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)