title: Gradle error when deploying to Nexus Repository
body: <p>Today, I have been migrating some Java plugins using maven to gradle. The plugins do successfully build properly however, I am having trouble automatically deploying them to our nexus. What I am trying to is upload my Java jar file automatically to nexus through grade's publish function.
  [![Gradle Publish][1]][1]
  [1]: https://i.stack.imgur.com/eYj3k.png</p>
  <p>The following is the error I am getting when attempting this through IntelliJ</p>
  <pre><code>Execution failed for task ':publishMavenPublicationToMavenRepository'.
  &gt; Failed to publish publication 'maven' to repository 'maven'
     &gt; Could not write to resource 'http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar'.
        &gt; Connection reset
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  </code></pre>
  <p>The following is a relavent snippet of the error with gradle's debug mode on:</p>
  <pre><code>    2021-07-13T18:06:40.978-0400 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 13][route: {}-&gt;http://nexus.grandtheftmc.net:80][total available: 0; route allocated: 0 of 20; total allocated: 0 of 20]
  2021-07-13T18:06:40.978-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Upload http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar' completed
  2021-07-13T18:06:40.978-0400 [INFO] [org.gradle.api.internal.artifacts.repositories.transport.NetworkOperationBackOffAndRetry] Error in 'PUT http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar'. Waiting 2000ms before next retry, 1 retries left
  2021-07-13T18:06:40.979-0400 [DEBUG] [org.gradle.api.internal.artifacts.repositories.transport.NetworkOperationBackOffAndRetry] Network operation failed
  org.gradle.api.resources.ResourceException: Could not write to resource 'http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar'.
      at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
      at org.gradle.internal.resource.ResourceExceptions.putFailed(ResourceExceptions.java:61)
      at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.put(AccessorBackedExternalResource.java:185)
      at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$3.call(BuildOperationFiringExternalResourceDecorator.java:100)
      at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$3.call(BuildOperationFiringExternalResourceDecorator.java:97)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
      at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator.put(BuildOperationFiringExternalResourceDecorator.java:97)
      at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher$ModuleArtifactPublisher$1.run(AbstractMavenPublisher.java:272)
      at org.gradle.api.internal.artifacts.repositories.transport.NetworkOperationBackOffAndRetry.withBackoffAndRetry(NetworkOperationBackOffAndRetry.java:50)
      at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher$ModuleArtifactPublisher.putResource(AbstractMavenPublisher.java:269)
      at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher$ModuleArtifactPublisher.publish(AbstractMavenPublisher.java:230)
      at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher$ModuleArtifactPublisher.publish(AbstractMavenPublisher.java:223)
      at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher.publish(AbstractMavenPublisher.java:81)
      at org.gradle.api.publish.maven.internal.publisher.MavenRemotePublisher.publish(MavenRemotePublisher.java:61)
      at org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher.publish(ValidatingMavenPublisher.java:50)
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository$1.publish(PublishToMavenRepository.java:109)
      at org.gradle.api.publish.internal.PublishOperation.run(PublishOperation.java:43)
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository.doPublish(PublishToMavenRepository.java:111)
      at org.gradle.api.publish.maven.tasks.PublishToMavenRepository.publish(PublishToMavenRepository.java:83)
      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.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:506)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:74)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:491)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:474)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:106)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:249)
      at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:83)
      at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:37)
      at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
      at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
      at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:47)
      at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:37)
      at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
      at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
      at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:50)
      at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
      at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
      at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
      at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
      at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
      at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
      at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:54)
      at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:35)
      at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
      at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
      at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:174)
      at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:74)
      at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:45)
      at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:40)
      at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:29)
      at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
      at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:99)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:92)
      at java.util.Optional.map(Optional.java:215)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
      at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:85)
      at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:42)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
      at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:91)
      at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:51)
      at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72)
      at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:46)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
      at java.util.Optional.orElseGet(Optional.java:267)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
      at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
      at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:210)
      at java.net.SocketInputStream.read(SocketInputStream.java:141)
      at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
      at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
      at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
      at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
      at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
      at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
      at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
      at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
      at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
      at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:170)
      at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:150)
      at org.gradle.internal.resource.transport.http.HttpResourceUploader.upload(HttpResourceUploader.java:40)
      at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.upload(DefaultExternalResourceConnector.java:76)
      at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceUploader.upload(ProgressLoggingExternalResourceUploader.java:39)
      at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.put(AccessorBackedExternalResource.java:182)
      ... 153 more
  2021-07-13T18:06:42.986-0400 [LIFECYCLE] [org.gradle.internal.operations.DefaultBuildOperationRunner] 
  2021-07-13T18:06:42.986-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Upload http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar' started
  2021-07-13T18:06:43.102-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Upload http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar'
  2021-07-13T18:06:43.102-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Execute publish for :publishMavenPublicationToMavenRepository'
  2021-07-13T18:06:43.102-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Executing task ':publishMavenPublicationToMavenRepository''
  2021-07-13T18:06:43.102-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot outputs after executing task ':publishMavenPublicationToMavenRepository'' started
  2021-07-13T18:06:43.102-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Snapshot outputs after executing task ':publishMavenPublicationToMavenRepository''
  2021-07-13T18:06:41.774-0400 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
  2021-07-13T18:06:41.774-0400 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] &gt; Task :publishMavenPublicationToMavenRepository FAILED
  2021-07-13T18:06:42.986-0400 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP PUT: http://nexus.grandtheftmc.net/content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar
  2021-07-13T18:06:42.987-0400 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
  2021-07-13T18:06:42.987-0400 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
  2021-07-13T18:06:42.987-0400 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {}-&gt;http://nexus.grandtheftmc.net:80][total available: 0; route allocated: 0 of 20; total allocated: 0 of 20]
  2021-07-13T18:06:42.987-0400 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 14][route: {}-&gt;http://nexus.grandtheftmc.net:80][total available: 0; route allocated: 1 of 20; total allocated: 1 of 20]
  2021-07-13T18:06:42.987-0400 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {}-&gt;http://nexus.grandtheftmc.net:80
  2021-07-13T18:06:42.987-0400 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to nexus.grandtheftmc.net/104.26.10.9:80
  2021-07-13T18:06:43.017-0400 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 172.27.235.237:60680&lt;-&gt;104.26.10.9:80
  2021-07-13T18:06:43.017-0400 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-14: set socket timeout to 30000
  2021-07-13T18:06:43.017-0400 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request PUT /content/repositories/releases/net/grandtheftmc/wastedguns/1.2.8/wastedguns-1.2.8.jar HTTP/1.1
  </code></pre>
  <p>Based of this error, it looks like for some reason, the connection is reset midway through the upload. The jar file its self <strong>is successfully built</strong>. In fact, if I manually upload the artifact to nexus, it works just fine. So this leads me to believe the issue lies somewhere in the upload process in gradle?</p>
  <p>The repository is a password-protected repository however, I do not believe this is a password issue <strong>because a separate module of this project with a nearly identical configuration did successfully upload to nexus</strong> (the non-identical part being the dependencies). This issue is also unlikely to be permission issues because I have full admin privileges on the repository I am trying to upload to.</p>
  <p>For your reference, here is my build.grade:</p>
  <pre><code>plugins {
      id &quot;java&quot;
      id &quot;com.github.johnrengelman.shadow&quot; version &quot;6.1.0&quot;
      id 'maven-publish'
  }
  
  group 'net.grandtheftmc'
  version '2.6.1'
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  compileJava.options.encoding = &quot;UTF-8&quot;
  compileTestJava.options.encoding = &quot;UTF-8&quot;
  
  repositories {
      maven {
          url 'http://repo.destroystokyo.com/repository/maven-public/'
          allowInsecureProtocol = true
      }
      maven {
          url 'http://nexus.grandtheftmc.net/content/repositories/releases/'
          allowInsecureProtocol = true
          credentials {
              username mavenUser
              password mavenPassword
          }
      }
      maven {
          url 'http://jitpack.io'
          allowInsecureProtocol = true
      }
      maven {
          url 'http://maven.sk89q.com/repo/'
          allowInsecureProtocol = true
      }
      maven {
          url 'http://repo.viaversion.com'
          allowInsecureProtocol = true
      }
      maven {
          url 'http://repo.citizensnpcs.co/'
          allowInsecureProtocol = true
      }
  }
  
  dependencies {
      compileOnly 'com.sk89q.worldedit:worldedit-bukkit:6.1.4-SNAPSHOT'
      compileOnly 'net.citizensnpcs:citizensapi:2.0.22'
      compileOnly 'us.myles:viaversion:3.1.0'
      compileOnly 'com.destroystokyo.paper:paper-api:1.12.2-R0.1-SNAPSHOT'
      compileOnly 'org.spigotmc:spigot:1.12.2-R0.1'
      compileOnly 'net.buycraft:BuycraftX:10.3.0'
      compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.0'
      compileOnly 'com.github.j0ach1mmall3:JLib:1.10.0'
      compileOnly 'net.grandtheftmc:wastedguns:1.2.6'
      compileOnly 'net.grandtheftmc:wastedvehicles:1.1.0'
      compileOnly 'net.grandtheftmc:wastedcops:1.1.0'
      compileOnly 'net.grandtheftmc:core:2.6.1'
      compileOnly 'net.grandtheftmc:houses:1.1.2'
      compileOnly 'com.gmail.filoghost.holographicdisplays:HolographicDisplays:1.0.0'
      implementation 'net.grandtheftmc:common:1.1.6'
      compileOnly 'com.earth2me:Essentials:2.0.0'
  }
  
  shadowJar {
      archiveFileName = project.name + &quot;.jar&quot;
      exclude 'META-INF', 'META-INF/**'
      destinationDirectory = file(&quot;build&quot;)
  }
  
  // Force character encoding in case the workspace was not set up correctly
  tasks.withType(Javadoc) {
      options.encoding = 'UTF-8'
  }
  
  publishing {
      publications {
          maven(MavenPublication) {
              artifactId = 'gtm'
              from components.java
          }
      }
      repositories {
          maven {
              url 'http://nexus.grandtheftmc.net/content/repositories/releases/'
              allowInsecureProtocol = true
              credentials {
                  username mavenUser
                  password mavenPassword
              }
          }
      }
  }
  </code></pre>
  <p>I am completely stumped as to what the issue can possibly be. Does anyone have any ideas?</p>