ANT 编译Tomcat 报错问题

Tomcat 专栏收录该内容
2 篇文章 0 订阅

   对Tomcat很感兴趣,想了解其原理和代码实现。于是就想在本地下载Tomcat源码进行编译,以便学习其源码。

但,过程很是艰辛,按照网上的编译Tomcat操作步骤,总是出现问题。我编译时出现的问题如下:

downloadzip:
      [get] Getting: https://downloads.sourceforge.net/easymock/easymock-3.2.zip
      [get] To: C:\Users\yangzb12941\tomcat-build-libs\download-1276673927.zip
      [get] Error getting https://downloads.sourceforge.net/easymock/easymock-3.
2.zip
to C:\Users\yangzb12941\tomcat-build-libs\download-1276673927.zip
BUILD FAILED
G:\Learn Workspace\apache-tomcat-8.0.52-src\build.xml:2824: The following error
occurred while executing this line:
G:\Learn Workspace\apache-tomcat-8.0.52-src\build.xml:2954: java.net.SocketExcep
tion: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:196)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
        at sun.security.ssl.InputRecord.read(InputRecord.java:480)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)

        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttps

URLConnection.java:185)

        at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
        at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:731)
        at org.apache.tools.ant.taskdefs.Get$GetThread.get(Get.java:652)

        at org.apache.tools.ant.taskdefs.Get$GetThread.run(Get.java:642)

    这表明是下载easymock-3.2.zip包时连接被重定向了,但在浏览器直接用如下地址是能下载easymock-3.2.zip文件。
            https://downloads.sourceforge.net/easymock/easymock-3.2.zip

    所以,这就有一个很巧的办法。在浏览器上下载文件,然后存放在网盘上里,把对应配置文件的url改为从网盘下载即可。若是百度网盘,则直接是文件的共享连接即可。由于easymock-3.2.zip是压缩包,但传输到本地之后还会报如下错误:

downloadzip:
      [get] Getting: https://pan.baidu.com/s/1SeBLpt6iC2hhj1aj3tAHGA(下载链接改为从网盘下载)
      [get] To: C:\Users\yangzb12941\tomcat-build-libs\download-85511030.zip
    [unzip] Expanding: C:\Users\yangzb12941\tomcat-build-libs\download-85511030.
zip into C:\Users\yangzb12941\tomcat-build-libs
BUILD FAILED
G:\Learn Workspace\apache-tomcat-8.0.52-src\build.xml:2824: The following error
occurred while executing this line:
G:\Learn Workspace\apache-tomcat-8.0.52-src\build.xml:2956: Error while expandin
g C:\Users\yangzb12941\tomcat-build-libs\download-85511030.zip

java.util.zip.ZipException: archive is not a ZIP archive(这是解压的时候出错)

屏蔽配置文件中<unzip ....../>就可以了。最后终于编译成功了!!!

  • 0
    点赞
  • 1
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值