试图将特定的lib打包到我的jar中是行不通的

问题描述 投票:1回答:1

我无法将所需的库包装到我的Jar中,阴影插件不会在控制台中提供任何类型的输出,使得它很难描述这里发生的事情,因为它更缺乏。

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.3</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <artifactSet>
                        <includes>
                            <include>org.javacord:javacord</include>
                        </includes>
                    </artifactSet>
                </configuration>
            </execution>
        </executions>
    </plugin>

我认为不应该这样做吗?

这是我试图打包的lib:

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.0.4</version>
    <type>pom</type>
    <scope>provided</scope>
</dependency>

控制台输出粘贴在这里:https://hastebin.com/soxafiqupe.cs

java maven maven-shade-plugin maven-eclipse-plugin
1个回答
0
投票

首先检查,如in here,你的插件定义是在你的pom中,而不是你的父pom(如果你有的话)

然后确保(如在this answer中)plugin部分在build部分内,而不是build/pluginManagement部分。

如果你想要更多的痕迹,mvn -X clean install会更加冗长。

© www.soinside.com 2019 - 2024. All rights reserved.