Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 无法将着色jar上载到nexus_Maven_Nexus - Fatal编程技术网

Maven 无法将着色jar上载到nexus

Maven 无法将着色jar上载到nexus,maven,nexus,Maven,Nexus,我正在尝试使用Gitlab Ci将maven项目部署到Nexus,但在尝试上载maven shade插件创建的着色jar时,管道总是失败。你知道为什么会这样吗 管道错误: [INFO] Uploading to pp-snapshots: https://nexus.myplayplanet.net/repository/myplayplanet-snapshots/net/myplayplanet/MyPlayPlanet-Core/1.14.0-SNAPSHOT/MyPlayPlanet-C

我正在尝试使用Gitlab Ci将maven项目部署到Nexus,但在尝试上载maven shade插件创建的着色jar时,管道总是失败。你知道为什么会这样吗

管道错误:

[INFO] Uploading to pp-snapshots: https://nexus.myplayplanet.net/repository/myplayplanet-snapshots/net/myplayplanet/MyPlayPlanet-Core/1.14.0-SNAPSHOT/MyPlayPlanet-Core-1.14.0-20190929.002150-7-shaded.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:53 min
[INFO] Finished at: 2019-09-29T00:21:51Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project MyPlayPlanet-Core: Failed to deploy artifacts: Could not transfer artifact net.myplayplanet:MyPlayPlanet-Core:jar:shaded:1.14.0-20190929.002150-7 from/to pp-snapshots (https://nexus.myplayplanet.net/repository/myplayplanet-snapshots/): Connection reset by peer (Write failed) -> [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/MojoExecutionException
shade插件配置:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.2.1</version>
    <configuration>
        <shadedArtifactAttached>true</shadedArtifactAttached>
        <filters>
            <filter>
                <artifact>*:*</artifact>
                <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                </excludes>
            </filter>
        </filters>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
        </execution>
    </executions>
</plugin>

org.apache.maven.plugins
maven阴影插件
3.2.1
真的
*:*
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA
包裹
阴凉处
错误是:

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) 
  on project MyPlayPlanet-Core: 

Failed to deploy artifacts: 

Could not transfer artifact net.myplayplanet:MyPlayPlanet-Core:jar:shaded:1.14.0-20190929.002150-7 
from/to pp-snapshots (https://nexus.myplayplanet.net/repository/myplayplanet-snapshots/)

Connection reset by peer (Write failed)
检查快照工件的大小,可能存在大小限制问题

还要检查本地使用的JDK版本,如中所示

通过以下方式禁用TLS 1.3协议:

-Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"

看起来我使用了错误的maven图像。
我刚刚使用了maven:latest,但当我将它改为maven:3.6.2-jdk-8时,它又能工作了。

很有趣。向上投票。Docker maven latest()是3.6.2-jdk-11,因此,正如我在回答中提到的,可能存在TLS问题。