Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

java - Maven "Invalid content was found starting with element"

Not sure why this happens, but I'm trying to fix an issue with signed jars in a minecraft plugin, I added this fix and it errors out at The pom code that is breaking is:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.6</version>
        <executions>
            <execution>
                <id>unpack-dependencies</id>
                <phase>package</phase>
                <goals>
                    <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                    <excludeScope>system</excludeScope>
                    <excludes>META-INF/*.SF</excludes>
                    <excludes>META-INF/*.DSA</excludes>
                    <excludes>META-INF/*.RSA</excludes>
                    <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </configuration>
            </execution>
        </executions>
    </plugin>

The error is:

Invalid content was found starting with element '{"http://maven.apache.org/POM/4.0.0":plugin}'. One of '{"http://maven.apache.org/POM/4.0.0":parent, "http://maven.apache.org/POM/4.0.0":prerequisites, "http://maven.apache.org/POM/4.0.0":issueManagement, "http://maven.apache.org/POM/4.0.0":ciManagement, "http://maven.apache.org/POM/4.0.0":inceptionYear, "http://maven.apache.org/POM/4.0.0":mailingLists, "http://maven.apache.org/POM/4.0.0":developers, "http://maven.apache.org/POM/4.0.0":contributors, "http://maven.apache.org/POM/4.0.0":profiles, "http://maven.apache.org/POM/4.0.0":modules, "http://maven.apache.org/POM/4.0.0":pluginRepositories, "http://maven.apache.org/POM/4.0.0":reports, "http://maven.apache.org/POM/4.0.0":dependencyManagement, "http://maven.apache.org/POM/4.0.0":distributionManagement}' is expected

Does anyone know what I can do? I'm not good at coding, by the way

As requested by someone, here's the full pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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.totalfreedom</groupId>
    <artifactId>TotalFreedomMod</artifactId>
    <version>2020.12</version>
    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <tfm.build.codename>Antaeus</tfm.build.codename>
        <jar.finalName>${project.name}</jar.finalName>
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>MM/dd/yyyy HH:mm</maven.build.timestamp.format>
    </properties>

    <name>TotalFreedomMod</name>
    <description>Server modification for the TotalFreedom server</description>
    <url>https://github.com/AtlasMediaGroup/TotalFreedomMod</url>

    <licenses>
        <license>
            <name>TotalFreedom General License</name>
            <url>https://github.com/TotalFreedom/License/blob/master/LICENSE.md</url>
        </license>
    </licenses>

    <organization>
        <name>TotalFreedom</name>
        <url>https://totalfreedom.me</url>
    </organization>

    <scm>
        <connection>scm:git:git@github.com:TFPatches/TotalFreedomMod.git</connection>
        <developerConnection>scm:git:git@github.com:TFPatches/TotalFreedomMod.git</developerConnection>
        <url>git@github.com:TFPatches/TotalFreedomMod.git</url>
    </scm>

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>

        <repository>
            <id>CodeMC</id>
            <url>https://repo.codemc.org/repository/maven-public/</url>
        </repository>

        <repository>
            <id>nms-repo</id>
            <url>https://repo.codemc.org/repository/nms/</url>
        </repository>

        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>

        <repository>
            <id>enginehub</id>
            <url>https://maven.enginehub.org/repo/</url>
        </repository>

        <repository>
            <id>elmakers-repo</id>
            <url>https://maven.elmakers.com/repository/</url>
        </repository>

        <repository>
            <id>sk89q-snapshots</id>
            <url>https://maven.sk89q.com/artifactory/repo</url>
        </repository>

        <repository>
            <id>jcenter</id>
            <name>jcenter-bintray</name>
            <url>https://jcenter.bintray.com</url>
        </repository>

        <repository>
            <id>playpro</id>
            <url>https://maven.playpro.com/</url>
        </repository>

        <repository>
            <id>md_5-public</id>
            <url>https://repo.md-5.net/content/groups/public/</url>
        </repository>

        <repository>
            <id>dmulloy2-repo</id>
            <url>https://repo.dmulloy2.net/nexus/repository/public/</url>
        </repository>

        <repository>
            <id>sk89q-repo</id>
            <url>https://maven.sk89q.com/repo/</url>
        </repository>

        <repository>
            <id>papermc</id>
            <url>https://papermc.io/repo/repository/maven-public/</url>
        </repository>

        <repository>
            <id>rayzr-repo</id>
            <url>https://cdn.rawgit.com/Rayzr522/maven-repo/master/</url>
        </repository>

        <repository>
            <id>ess-repo</id>
            <url>https://ci.ender.zone/plugin/repository/everything/</url>
        </repository>
    </repositories>

    <dependencies>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.11</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.15</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.github.speedxx</groupId>
            <artifactId>Mojangson</artifactId>
            <version>1957eef8d6</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.bstats</groupId>
            <artifactId>bstats-bukkit</artifactId>
            <version>1.8</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.github.TotalFreedomMC</groupId>
            <artifactId>BukkitTelnet</artifactId>
            <version>541e9fdb84</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.github.TotalFreedomMC</groupId>
            <artifactId>TF-LibsDisguises</artifactId>
            <version>48f01cf2fe</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.3.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>net.ess3</groupId>
            <artifactId>EssentialsX</artifactId>
            <version>2.18.2</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>4.2.0_224</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>net.coreprotect</groupId>
            <artifactId>coreprotect</artifactId>
            <version>19.3</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.sk89q.worldguard</groupId>
            <artifactId>worldguard-bukkit</artifactId>
            <version>7.0.4</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.papermc</groupId>
            <artifactId>paperlib</artifactId>
            <version>1.0.6</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>me.rayzr522</groupId>
            <artifactId>jsonmessage</artifactId>
            <version>1.0.0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.github.vexsoftware</groupId>
            <artifactId>votifier</artifactId>
            <version>v1.9</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>net.goldtreeservers</groupId>
            <artifact

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to reply this article.

OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...