You need to enable JavaScript to run this app. Maven sdcf4j-twitch构建失败:lombok传递依赖版本为+致jitpack.io报400
优惠活动
大模型
产品
解决方案
定价
更多

Maven sdcf4j-twitch构建失败:lombok传递依赖版本为+致jitpack.io报400

Maven项目sdcf4j-twitch构建报错记录

报错场景

我在构建Maven项目sdcf4j-twitch时遇到如下错误,该问题属于Maven包含未定义依赖的场景:

[ERROR] Failed to execute goal on project sdcf4j-twitch: Could not resolve dependencies for project com.github.twitch4j:sdcf4j-twitch:jar:1.0.9: Failed to collect dependencies at com.github.twitch4j:twitch4j:jar:v0.10.2 -> org.projectlombok:lombok:jar:+: Failed to read artifact descriptor for org.projectlombok:lombok:jar:+: Could not transfer artifact org.projectlombok:lombok:pom:+ from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/org/projectlombok/lombok/+/lombok-+.pom 400 Bad Request -> [Help 1]

已尝试的排查操作

以下操作均未解决核心报错:

  • 彻底清除IntelliJ IDEA的相关配置文件、重新添加依赖,仅处理了IDE显示的部分错误依赖,核心报错未消除
  • 移除所有lombok插件、不配置lombok注解路径
  • 执行mvn clear命令清理环境

项目POM配置

当前项目的Maven POM配置代码如下:

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <parent>
        <groupId>de.btobastian.sdcf4j</groupId>
        <artifactId>sdcf4j</artifactId>
        <version>1.0.9</version>
    </parent>
    <groupId>com.github.twitch4j</groupId>
    <artifactId>sdcf4j-twitch</artifactId>
    <version>1.0.9</version>
    <repositories>
        <repository>
            <id>jcenter</id>
            <url>https://jcenter.bintray.com/</url>
        </repository>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.16</version>
                        </path>
                    </annotationProcessorPaths>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <!-- Include source -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.0.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Include JavaDocs -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.2</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <stylesheet>java</stylesheet>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <!-- The core module -->
        <dependency>
            <groupId>de.btobastian.sdcf4j</groupId>
            <artifactId>sdcf4j-core</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.github.twitch4j</groupId>
            <artifactId>twitch4j</artifactId>
            <version>v0.10.2</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.16</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

项目结构说明

  • 该项目的父POM与官方原始版本完全一致,对应地址为:https://github.com/Bastian/sdcf4j/blob/8f569ee5dc36be09c6595c12833d109b7127c23e/pom.xml
  • 若目录结构配置正确,可将sdcf4j-twitch作为模块添加至sdcf4j父项目中,配置方式与上述父POM第17行的sdcf4j-core、sdcf4j-discord4j模块完全相同。

完整构建日志

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.github.twitch4j:sdcf4j-twitch >------------------
[INFO] Building sdcf4j-twitch 1.0.9
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from jitpack.io: https://jitpack.io/org/projectlombok/lombok/+/lombok-+.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.968 s
[INFO] Finished at: 2020-12-10T22:55:31+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sdcf4j-twitch: Could not resolve dependencies for project com.github.twitch4j:sdcf4j-twitch:jar:1.0.9: Failed to collect dependencies at com.github.twitch4j:twitch4j:jar:v0.10.2 -> org.projectlombok:lombok:jar:+: Failed to read artifact descriptor for org.projectlombok:lombok:jar:+: Could not transfer artifact org.projectlombok:lombok:pom:+ from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/org/projectlombok/lombok/+/lombok-+.pom 400 Bad Request -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

恳请各位技术专家给出可行的排查思路或解决方案,解决该Maven未定义依赖导致的构建失败问题。


内容的提问来源于stack exchange,提问作者C0D3 M4513R

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.13 22:06:09