Pom.xml artifactSet 错误

Pom.xml error with artifactSet

这是我的 pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.JackboyPlay.BCC</groupId>
<artifactId>BungeeCordCore</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
        <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>
                <artifactSet>
                    <includes>
                        <include>org.spigotmc:bungeecord</include> <!-- Set "org.spigotmc" to the bungeecord groupId -->
                    </includes>
                </artifactSet>
            </execution>

        </executions>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <targetPath>.</targetPath>
            <filtering>true</filtering>
            <directory>${basedir}/src/</directory>
            <includes>
                <include>plugin.yml</include>
            </includes>
        </resource>
    </resources>
</build>

</artifactSet> 在 eclipse 中带有红色下划线。我试图删除这一行,但另一行带有红色下划线。 如果有人知道如何修复错误,请随时回答:)

问题是 artifactSet 应该设置在 configuration 标签内。

试试这个:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>me.JackboyPlay.BCC</groupId>
    <artifactId>BungeeCordCore</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <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.spigotmc:bungeecord
                                    </include> <!-- Set "org.spigotmc" to the bungeecord groupId -->
                                </includes>
                            </artifactSet>
                        </configuration>
                    </execution>

                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <targetPath>.</targetPath>
                <filtering>true</filtering>
                <directory>${basedir}/src/</directory>
                <includes>
                    <include>plugin.yml</include>
                </includes>
            </resource>
        </resources>
    </build> </project>