Javaビルドプロセスでmavenを使用しています。以下は、すべての依存関係を持つ単一の jar を作成するコードのスニペットです。ビルドへの小さな変更でのデータ転送を減らすために、すべてのプロジェクト ファイル (依存関係を含む) をフォルダー target/build に配置したいと思います。アプリを実行しているリモート マシンとフォルダーを再同期し、次のコマンドでアプリを実行する予定です。
java -cp target/build/* <classname>
これを実現するためにこのスニペットを変更するにはどうすればよいですか? ここのドキュメントを読みましたが、修正をつなぎ合わせる方法がわかりません:
- http://maven.apache.org/plugins/maven-assembly-plugin/
- http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html
<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>