我需要创建一个带有依赖项的 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>
....