Error uploading a JAR file to project's maven repository - Broken pipe (Write failed)

Hello everyone,

I need some assistance deploying a JAR file to my project’s maven repository.
I am building a Clojure application, and have a prebuilt, JAR file artifact that I wish to deploy to the maven repository, as is. Hence, I opted to use mvn deploy:deploy-file instead of mvn deploy as written in the gitlab documentation.

I am facing the current error:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.820 s
[INFO] Finished at: 2019-08-20T07:38:44+00:00
[INFO] Final Memory: 12M/56M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project elvn-dbtx: Failed to deploy artifacts: Could not transfer artifact elvn-dbtx:elvn-dbtx:jar:1.0.0-20190820.073844-1 from/to gitlab-maven (http://gitlab.com/api/v4/groups/runeleven/-/packages/maven/): Broken pipe (Write failed) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project elvn-dbtx: Failed to deploy artifacts: Could not transfer artifact elvn-dbtx:elvn-dbtx:jar:1.0.0-20190820.073844-1 from/to gitlab-maven (http://gitlab.com/api/v4/groups/runeleven/-/packages/maven/): Broken pipe (Write failed)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact elvn-dbtx:elvn-dbtx:jar:1.0.0-20190820.073844-1 from/to gitlab-maven (http://gitlab.com/api/v4/groups/runeleven/-/packages/maven/): Broken pipe (Write failed)
	at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:314)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact elvn-dbtx:elvn-dbtx:jar:1.0.0-20190820.073844-1 from/to gitlab-maven (http://gitlab.com/api/v4/groups/runeleven/-/packages/maven/): Broken pipe (Write failed)
	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
	at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
	at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:310)
	... 22 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact elvn-dbtx:elvn-dbtx:jar:1.0.0-20190820.073844-1 from/to gitlab-maven (http://gitlab.com/api/v4/groups/runeleven/-/packages/maven/): Broken pipe (Write failed)
	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317)
	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
	... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact elvn-dbtx:elvn-dbtx:jar:1.0.0-20190820.073844-1 from/to gitlab-maven (http://gitlab.com/api/v4/groups/runeleven/-/packages/maven/): Broken pipe (Write failed)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
	... 27 more
Caused by: org.apache.maven.wagon.TransferFailedException: Broken pipe (Write failed)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:646)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497)
	at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
	at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
	at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
	... 29 more
Caused by: java.net.SocketException: Broken pipe (Write failed)
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
	at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:123)
	at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:135)
	at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:164)
	at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon$RequestEntityImplementation.writeTo(AbstractHttpClientWagon.java:205)
	at org.apache.maven.wagon.providers.http.httpclient.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:155)
	at org.apache.maven.wagon.providers.http.httpclient.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:149)
	at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:236)
	at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:254)
	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:86)
	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
	at org.apache.maven.wagon.providers.http.httpclient.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
	at org.apache.maven.wagon.providers.http.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:832)
	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:592)
	... 38 more

My settings are as follows:
settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>gitlab-maven</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Job-Token</name>
            <value>${env.CI_JOB_TOKEN}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
  </servers>
</settings>

pom.xml:

<?xml version="1.0" encoding="UTF-8"?> 4.0.0 ID ID 1.0.0-SNAPSHOT NAME org.apache.httpcomponents httpclient 4.5.9 org.apache.httpcomponents httpclient 4.5.9 gitlab-maven https://gitlab.com/api/v4/groups/xxxxxxx/-/packages/maven gitlab-maven https://gitlab.com/api/v4/projects/xxxxxxx/packages/maven gitlab-maven https://gitlab.com/api/v4/projects/xxxxxxx/packages/maven ``` ___ `.gitlab-ci.yaml` job config: ``` deploy-jar: stage: deploy-jar image: maven:3.3.9-jdk-8 script: - mvn -e -X deploy:deploy-file -Durl=https://gitlab.com/api/v4/groups/xxxxxx/-/packages/maven/ -DrepositoryId=gitlab-maven -Dfile=./target/ID-1.0.0-SNAPSHOT.jar -DgroupId=ID -DartifactId=ID -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true ``` ___ Any help is appreciated! Thank you!

@melkar.muallem I am facing similar issue. Did you have any luck figuring out why it was not able to upload the jar?