Lfs
無法建構 Apache-ant-1.10.5
我正在嘗試建構 BLFS 8.4 嘗試使用 fetch.xml ant 建構腳本下載執行時依賴項時發生錯誤:
bootstrap/bin/ant -f fetch.xml -Ddest=optional
錯誤:
BUILD FAILED /sources/BLFS/apache-ant-1.10.5/fetch.xml:212: The following error occurred while executing this line: sources/BLFS/apache-ant-1.10.5/fetch.xml:122: Unable to resolve artifact: Missing: -------- 1) org.apache.ant:ant-antunit:jar:1.4 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.apache.ant -DartifactId=ant-antunit -Dversion=1.4 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.apache.net -DartifactId=ant-antunit -Dversion=1.4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) org.apache.maven:super-pom:pom:2.0 2) org.apache.ant:ant-antunit:jar:1.4 ---------- 1 required artifact is missing. for artifact: org.apache.maven:super-pom:pom:2.0 from the specified remote repositories: central (http://repo1.maven.org/maven2/)
由於硬體限制,我正在主機上建構 BLFS 8.4。我正在使用 bash 5.0
我嘗試使用Building Ant (Ant 手冊)中的說明 結合Apache Ant 安裝(BLFS 8.4)手動建構版本並得到您的錯誤:
$ export JAVA_HOME=/path/to/my/java-11-openjdk-amd64 $ ./bootstrap.sh $ bootstrap/bin/ant -f fetch.xml -Ddest=optional ... [artifact:dependencies] Downloading: org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.pom from repository central at http://repo1.maven.org/maven2/ [artifact:dependencies] Error transferring file: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.pom [artifact:dependencies] [WARNING] Unable to get resource 'org.apache.ant:ant-antunit:pom:1.4' from repository central (http://repo1.maven.org/maven2/): Error transferring file: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.pom [artifact:dependencies] Downloading: org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.jar from repository central at http://repo1.maven.org/maven2/ [artifact:dependencies] Error transferring file: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.jar [artifact:dependencies] [WARNING] Unable to get resource 'org.apache.ant:ant-antunit:jar:1.4' from repository central (http://repo1.maven.org/maven2/): Error transferring file: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.jar [artifact:dependencies] An error has occurred while processing the Maven artifact tasks. ...
如果你打開http://repo1.maven.org/maven2/org/apache/ant/ant-antunit/1.4/ant-antunit-1.4.pom你會看到 https 是必需的。
解決方案
編輯URL
./lib/libraries.properties
並將其更改為(第 29 行)m2.repo``http``https
# Repository to use by default for fetching dependencies. m2.repo=https://repo1.maven.org/maven2/
並執行
bootstrap/bin/ant -f fetch.xml -Ddest=optional
再次。