exec:execゴールを使用してmavenexecプラグインを使用してJavaプログラムを実行しようとしています。
クラスパスにjarを追加する必要があります(sun tools jar)。
includePluginDependenciesはexec:javaの目標に対してのみ機能するため、引数セクションに手動で追加することを考えましたが、基本クラスパスに連結する方法が見つかりませんでした。問題は、jarがシステムスコープとして定義されているため、mavenがそれをランタイムクラスパスに追加せず、手動で追加する必要があることです。
誰かがコマンドラインからそうする方法を知っているなら、それはさらに良いです。よろしくお願いします、
Avner
以下のプラグインセクションを見ることができます
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <scope>system</scope> <systemPath>${JDK_HOME}/lib/tools.jar</systemPath> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>myArtifact</artifactId> <version>1.0</version> </dependency> </dependencies> <configuration> <executable>java</executable> <arguments> <argument>-classpath</argument> <classpath/> <argument>com.mycompany.MyMainClass</argument> </arguments> </configuration> <executions> <execution> <goals> <goal>exec</goal> </goals> </execution> </executions> </plugin>