【问题标题】:How to add craftbukkit to minecraft 1.19.3 plugin as dependency?如何将 craftbukkit 作为依赖项添加到 minecraft 1.19.3 插件?
【发布时间】:2023-02-11 16:15:22
【问题描述】:

我正在尝试更新一个插件 [在 1.18.2 中],我没有自己写到 minecraft 1.19.3。 但是,我正在努力弄清楚如何将 craftbukkit 添加为依赖项。我使用 maven,它似乎无法在 mvnrepository.com 中找到 1.19.3。进一步的调查让我找到了 buildtools,我运行了它,它确实给了我几个文件夹和 jar 文件,其中之一是 craftbukkit、spigot 和 bukkit。

但是,尝试将这些 jar 文件添加为依赖项也会给我带来引用不存在文件的错误。即使该文件确实存在于项目的资源文件夹中。

<dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>craftbukkit</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>/GUIMarketplaceDirectory-master/src/main/resources/craftbukkit-1.19.3.jar</systemPath>
        </dependency>

我还尝试更改路径以从我的源文件夹开始,但这没有用。任何帮助,将不胜感激。

【问题讨论】:

  • 检查here 并将版本更改为 1.19.3

标签: maven minecraft bukkit build-dependencies spigot


【解决方案1】:

我不确定您是否可以将 CraftBukkit 添加为依赖项。它需要是 bukkit 或 spigot,因为 CraftBukkit 是一个服务器模块,而不是插件 API。这是 Spigot 导入的代码。

<repositories>
            <!-- This adds the Spigot Maven repository to the build -->
            <repository>
                    <id>spigot-repo</id>
                    <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
            </repository>
    </repositories>

    <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
            <!--This adds the Spigot API artifact to the build -->
            <dependency>
                    <groupId>org.spigotmc</groupId>
                    <artifactId>spigot-api</artifactId>
                    <version>1.19.3-R0.1-SNAPSHOT</version>
                    <scope>provided</scope>
            </dependency>
    </dependencies>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-03
    • 2016-03-28
    • 1970-01-01
    • 2012-06-05
    • 2021-06-18
    相关资源
    最近更新 更多