我做了一个brew install maven,结果如下:
==> Downloading http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
==> Best Mirror http://apache.oss.eznetsols.org/maven/binaries/apache-maven-3.0.4-bin.tar.gz
curl: (22) The requested URL returned error: 404
Error: Download failed: http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
Run Code Online (Sandbox Code Playgroud)
起初我认为这是我网络的镜像问题.但我换了另一个网络,它仍然是一样的.4天后仍然是同样的错误.我想知道其他人是否受到影响.
如何用brew安装maven?
Eam*_*ney 18
这面镜子有些奇怪.你可以改变它
brew edit maven
Run Code Online (Sandbox Code Playgroud)
并将网址更改为
http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
例如
要求'公式'
class Maven < Formula
homepage 'http://maven.apache.org/'
#url 'http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz'
url 'http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz'
sha1 '0de5dc162bafde3fcb0a6b009cfeea81a042523b'
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
# Fix the permissions on the global settings file.
chmod 0644, Dir["conf/settings.xml"]
prefix.install %w{ NOTICE.txt LICENSE.txt README.txt }
# Install jars in libexec to avoid conflicts
libexec.install Dir['*']
bin.install_symlink Dir["#{libexec}/bin/*"]
end
end
Run Code Online (Sandbox Code Playgroud)
小智 7
ZenBalance的答案对我有用.我首先尝试了Emoloney的回答,这在我跑的时候导致了以下错误brew update:
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/maven.rb
Please, commit your changes or stash them before you can merge.
Aborting Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
要解决这个问题:
cd /usr/local/Library/Formula
git reset --hard
Run Code Online (Sandbox Code Playgroud)
然后:
brew update
brew install maven
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14306 次 |
| 最近记录: |