无法从 Maven 3.5.2 降级到 Maven 3.0.4:没有名称为 "maven30" 的可用公式
not able to downgrade from maven 3.5.2 to maven 3.0.4 : No available formula with the name "maven30"
我已经使用
卸载了 maven
brew uninstall maven
并尝试使用
再次安装
brew install maven30
但我遇到了这个错误
brew install maven30
Error: No available formula with the name "maven30"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: curl is not executable
然而,当我使用 brew install maven
时,它也被下载并安装了
brew install maven
==> Downloading https://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.5.2/b
Already downloaded: /Users/amar/Library/Caches/Homebrew/maven-3.5.2.tar.gz
/usr/local/Cellar/maven/3.5.2: 104 files, 10.1MB, built in 3 seconds
所以为什么我在 maven30
中得到 curl is not executable
我也试过了
brew tap homebrew/versions
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
我从 here 下载了 3.0.4 的 mvn
zip 文件,然后执行位于 bin 文件中的 mvn
命令,如下所示
amar@admin:~/Downloads/apache-maven-3.0.4$ tree -L 2
├── LICENSE.txt
├── NOTICE.txt
├── README.txt
├── bin
│ ├── m2.conf
│ ├── mvn
│ ├── mvn.bat
│ ├── mvnDebug
│ ├── mvnDebug.bat
│ └── mvnyjp
现在转到 bin 文件夹并查询版本
amar@admin:~/Downloads/apache-maven-3.0.4/bin$ ./mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /Users/amar/Downloads/apache-maven-3.0.4
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"
现在它工作正常,另一个步骤是卸载当前版本并使用 brew uninstall maven
和 brew unlink maven
取消链接
现在您可以在 bash_profile
中添加当前 Maven 二进制文件的路径并获取它。下面是例子
export M2_HOME=/Users/amar/Downloads/apache-maven-3.0.4
export PATH=$PATH:$M2_HOME/bin
再次尝试检查版本,对我有用
amar@admin:~$ mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /Users/amar/Downloads/apache-maven-3.0.4
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"
amar@admin:~$
我已经使用
卸载了 mavenbrew uninstall maven
并尝试使用
再次安装brew install maven30
但我遇到了这个错误
brew install maven30
Error: No available formula with the name "maven30"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: curl is not executable
然而,当我使用 brew install maven
时,它也被下载并安装了
brew install maven
==> Downloading https://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.5.2/b
Already downloaded: /Users/amar/Library/Caches/Homebrew/maven-3.5.2.tar.gz
/usr/local/Cellar/maven/3.5.2: 104 files, 10.1MB, built in 3 seconds
所以为什么我在 maven30
curl is not executable
我也试过了
brew tap homebrew/versions
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
我从 here 下载了 3.0.4 的 mvn
zip 文件,然后执行位于 bin 文件中的 mvn
命令,如下所示
amar@admin:~/Downloads/apache-maven-3.0.4$ tree -L 2
├── LICENSE.txt
├── NOTICE.txt
├── README.txt
├── bin
│ ├── m2.conf
│ ├── mvn
│ ├── mvn.bat
│ ├── mvnDebug
│ ├── mvnDebug.bat
│ └── mvnyjp
现在转到 bin 文件夹并查询版本
amar@admin:~/Downloads/apache-maven-3.0.4/bin$ ./mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /Users/amar/Downloads/apache-maven-3.0.4
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"
现在它工作正常,另一个步骤是卸载当前版本并使用 brew uninstall maven
和 brew unlink maven
现在您可以在 bash_profile
中添加当前 Maven 二进制文件的路径并获取它。下面是例子
export M2_HOME=/Users/amar/Downloads/apache-maven-3.0.4
export PATH=$PATH:$M2_HOME/bin
再次尝试检查版本,对我有用
amar@admin:~$ mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /Users/amar/Downloads/apache-maven-3.0.4
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"
amar@admin:~$