私はおそらくこの質問のようなものが必要です
または mavenアセンブリは、依存関係とクラスパスを使用してjarを作成します
実行可能な jar を実行するにはどうすればよいですか?
コマンドラインで java -jar を実行すると、スレッド「メイン」で例外が発生します java.lang.NoClassDefFoundError: org/apache/log4j/Logger
/lib ディレクトリの下にすべての依存関係の jar を含む、ターゲット ディレクトリと lib ディレクトリに executable.jar を作成しました。
これは私の 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>