当pom文件上传时,无法将jar文件上传到nexus 3

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

我有一个简单的 Spring Boot 应用程序,通过命令

mvn clean deploy
将其部署到存储库管理器 nexus。 问题是运行maven命令后,我可以看到打包的pom文件已上传,而jar文件未上传,并出现错误消息。

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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>org.billing</groupId>
    <artifactId>billing-service</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>billing-service</name>
    <description>billing-service</description>


    <properties>
        <java.version>17</java.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>nexus.snapshot</id>
            <name>nexus-snapshot</name>
            <url>http://IP-ADDRESS/repository/billing-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

我收到错误:

[INFO] --- maven-deploy-plugin:3.1.1:deploy (default-deploy) @ billing-service ---
Downloading from nexus.snapshot: http://IP-ADDRESS/repository/billing-snapshots/org/billing/billing-service/0.0.1-SNAPSHOT/maven-metadata.xml
Uploading to nexus.snapshot: http://IP-ADDRESS/repository/billing-snapshots/org/billing/billing-service/0.0.1-SNAPSHOT/billing-service-0.0.1-20240305.221751-1.pom
Uploaded to nexus.snapshot: http://IP-ADDRESS/repository/billing-snapshots/org/billing/billing-service/0.0.1-SNAPSHOT/billing-service-0.0.1-20240305.221751-1.pom (2.4 kB at 1.8 kB/s)
Uploading to nexus.snapshot: http://IP-ADDRESS/repository/billing-snapshots/org/billing/billing-service/0.0.1-SNAPSHOT/billing-service-0.0.1-20240305.221751-1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.894 s
[INFO] Finished at: 2024-03-05T23:18:11+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy (default-deploy) on project billing-service: Failed to deploy artifacts: Could not transfer artifact org.billing:billing-service:jar:0.0.1-2024
0305.221751-1 from/to nexus.snapshot (http://IP-ADDRESS/repository/billing-snapshots/): transfer failed for http://IP-ADDRESS/repository/billing-snapshots/org/billing/billing-service/0.0.1-SNAPSHOT/billing-servic
e-0.0.1-20240305.221751-1.jar: Connection reset by peer -> [Help 1]

即使我在pom文件中添加了打包jar标签,也没有作用。 正如错误日志建议的那样,我在调试模式下运行 mvn deploy,我注意到这个指示,但我不明白它的含义:

[DEBUG] Failed to dispatch transfer event 'PUT PROGRESSED http://IP-ADDRESS/repository/billing-snapshots/org/billing/billing-service/0.0.1-SNAPSHOT/billing-service-0.0.1-20240305.220831-1.jar <> C:\Users\ergai\Desktop\devo
ps-digital-oceans-projects\billing-service\target\billing-service-0.0.1-SNAPSHOT.jar' to org.apache.maven.cli.transfer.ConsoleMavenTransferListener
java.lang.IllegalArgumentException: progressed file size cannot be greater than size: 64430080 > 22686224
spring-boot maven nexus
1个回答
0
投票

网络问题,很难弄清楚发生了什么。

检查:

  • 您的 Nexus 可通过浏览器访问
  • 检查您的存储库是否可浏览。
  • 检查您的存储库路径是否正确并且可以在 Nexus 存储库选项中访问
  • 检查您的计算机和/或 Nexus 服务器上是否没有阻止您连接的防火墙。
  • 您确定您的 Nexus 不使用 https 吗?此类错误消息通常与 TLS 问题(不兼容)有关。
© www.soinside.com 2019 - 2024. All rights reserved.