12

依存関係 (maven シェード プラグイン、maven 依存関係プラグイン、maven アセンブリ プラグイン) を使用して実行可能 jar をビルドするための多くのソリューションを読み、このすべてのプラグインが依存関係 jar をアンパックし、実行可能 jar に再​​パックします。実行可能 jar にアンパックされた依存関係 jar をパックする唯一のプラグインは 1 つの jar プラグインですが、このプラグインはそのランナー コードを実行可能 jar に追加します。

このようなjarを作成する解決策はありますか:

├─executable.jar
├──lib/
├───dependency1.jar
├───dependency2.jar
.
.
.

そしてその解決策が機能します。

4

2 に答える 2

0
<plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>org.test.int1.Main</mainClass>
                </configuration>
            </plugin>
        </plugins>
于 2013-07-17T07:40:11.733 に答える