我正在使用 wagon 插件通过 FTPS/990 将构建发送到远程服务器,所有文件都已成功发送,除了meduim 大文件(例如:75 MB),连接似乎已关闭,我收到以下错误:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.0:upload (default-cli) on project XXXX: Error handling resource
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: Error handling resource
at org.codehaus.mojo.wagon.AbstractSingleWagonMojo.execute(AbstractSingleWagonMojo.java:67)
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.wagon.TransferFailedException: PUT request to: XXXX.war in ftp.server.id failed
at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:448)
at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:416)
at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:390)
at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163)
at org.codehaus.mojo.wagon.shared.DefaultWagonUpload.upload(DefaultWagonUpload.java:76)
at org.codehaus.mojo.wagon.shared.DefaultWagonUpload.upload(DefaultWagonUpload.java:87)
at org.codehaus.mojo.wagon.UploadMojo.execute(UploadMojo.java:112)
at org.codehaus.mojo.wagon.AbstractSingleWagonMojo.execute(AbstractSingleWagonMojo.java:63)
... 22 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
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.commons.net.io.SocketOutputStream.write(SocketOutputStream.java:71)
at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:540)
at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:435)
编辑 :
在 pom.xml 中使用的配置下方:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<serverId>ftp.server.id</serverId>
<url>ftps://IP_ADDRESS:990</url>
<fromDir>${project.build.directory}</fromDir>
<toDir>.</toDir>
</configuration>
<executions>
<execution>
<id>upload</id>
<phase>deploy</phase>
<goals>
<goal>upload</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>3.0.0</version>
</extension>
</extensions>
以及 settings.xml 中 serverId 的配置:
<server>
<id>ftp.server.id</id>
<username>username</username>
<password>password</password>
<configuration>
<endpointChecking>false</endpointChecking>
<securityProtocol>TLSv1.2</securityProtocol>
<implicit>true</implicit>
<passiveMode>true</passiveMode>
</configuration>
</server>
感谢帮助 !
此致