我可能需要这样的问题与使用maven的依赖,而不拆包罐子,但可执行的JAR文件包括类路径
Maven build assembly with dependencies
或 maven assembly create jar with dependency and class path
如何执行可执行的JAR?在命令行
Java的罐子给我 异常在线程“主要” java.lang.NoClassDefFoundError:组织/阿帕奇/ log4j的/记录器
我已经executable.jar我的目标目录和lib目录下的所有创造依赖关系jar下的/ lib直接。
这是我的pom.xml的片段。我应该改变什么?
</dependencies>
<dependency>
<groupId><gId></groupId>
<artifactId><aId></artifactId>
<version><v></version>
</dependency>
<dependency>
<groupId>gI2</groupId>
<artifactId>aI2</artifactId>
<version>v</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.proj.app</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>