我试图通过Jenkins在tomcat7上部署基于maven的web项目.当我尝试从我的命令提示符执行maven目标"mvn tomcat7:deploy"时,它运行良好并在运行tomcat7实例上部署应用程序.现在我在Jenkins上为相同的项目设置了一个Job,并收到套接字错误.下面是我的代码和Jenkins控制台的堆栈跟踪.
在POM.xml中输入
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>Tomcat7Server</server>
<path>/ElecnorMPR</path>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
Apache Maven Settings.xml
<server>
<id>Tomcat7Server</id>
<username>tomcat</username>
<password>tomcat</password>
</server>
Run Code Online (Sandbox Code Playgroud)
已经在tomcat-user.xml中定义了用户.
[DEBUG] Connection 0.0.0.0:51036<->127.0.0.1:8080 closed
[DEBUG] Closing the connection.
[DEBUG] Connection 0.0.0.0:51036<->127.0.0.1:8080 closed
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[DEBUG] Connection reset by peer: socket write error
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:181)
at org.apache.http.impl.conn.LoggingSessionOutputBuffer.write(LoggingSessionOutputBuffer.java:73)
at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
at org.apache.tomcat.maven.common.deployer.TomcatManager$RequestEntityImplementation.writeTo(TomcatManager.java:880) …Run Code Online (Sandbox Code Playgroud)