Maven插件创建可执行jar,依赖项未解包(带jar的jar)

dal*_*983 12 java executable dependencies jar

我阅读了很多解决方案来构建带有依赖项的可执行jar(maven shade插件,maven依赖插件,maven程序集插件)以及所有这些插件解压缩依赖jar并在可执行jar中重新打包它们.在可执行jar中解包依赖jar的唯一插件是一个jar插件,但是这个插件在可执行jar中添加了它的转子代码.

是否有任何解决方案来创建这样的jar:

??executable.jar
???lib/
????dependency1.jar
????dependency2.jar
.
.
.
Run Code Online (Sandbox Code Playgroud)

和那个解决方案.

小智 -1

<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>
Run Code Online (Sandbox Code Playgroud)