Javaベースのコマンドラインアプリとそのすべての依存関係をmavenとlaunch4jを使って単一の* .exeファイルにラップしたいと思います。launch4jとmavenを使ってJavaコマンドラインアプリケーションをラップする
今私はthis oneとthisのようにすべての同様の質問を読みましたが、動作させることはできません。
誰でも簡単なpom.xmlスニペットを提供できます。これはどのようにして必要なすべての依存関係を実現できますか? そして、私はEclipsesで実行する必要がありますか?
<!-- Launch4j -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached> <!-- Make the shaded artifact not the main one -->
<shadedClassifierName>shaded</shadedClassifierName> <!-- set the suffix to the shaded jar -->
</configuration>
</plugin>
<plugin>
<groupId>org.bluestemsoftware.open.maven.plugin</groupId>
<artifactId>launch4j-plugin</artifactId>
<version>1.5.0.0</version>
<executions>
<!-- Command-line exe -->
<execution>
<id>l4j-cli</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>console</headerType>
<outfile>target/importer.exe</outfile>
<jar>target/${artifactId}-${version}-shaded.jar</jar> <!-- 'shaded' is the value set on shadedClassifierName above -->
<errTitle>App Err</errTitle>
<classPath>
<mainClass>${mainClass}</mainClass>
</classPath>
<jre>
<minVersion>1.5.0</minVersion>
<maxVersion>1.6.0</maxVersion>
<initialHeapSize>128</initialHeapSize>
<maxHeapSize>1024</maxHeapSize>
</jre>
</configuration>
</execution>
</executions>
</plugin>
私はlaunch4jを実行すると::ここで
私はSOからコピーしたものである(?これは正しいものである場合)Eclipseで目標をlaunch4j私が取得:
ゴールを実行できませんでした org.bluestemsoftware.open.maven.plugin:launch4j-plugin:1.5.0.0:launch4j (default-cli):プロジェクトのインポーターで:パラメータ 'headerType'、 'jre' のパラメータ org.bluestemsoftware.open.maven.plugin:launch4j-プラグイン:1.5.0.0:launch4j が見つからないか、または無効です - > [ヘルプ1]
たぶん私はちょうど...
を偽の目標を立ち上げています
[this](https://github.com/vorburger/launch4j-maven-plugin)プラグインで試してみてはいかがですか?これは新しいと思われますか? – Raghuram
vorburgerプラグインは有望そうですが、どの目標を実行する必要がありますか? – Drejc
mvn installを実行します。必要なクラスが見つかりません:com.akathist.maven.plugins.launch4j.Launch4jMojo failure。これはvorburgerのデモ・アプリケーションにあります。 – Drejc