gpt4 book ai didi

intellij-idea - zsh "command not found: plugin:"用于 build.gradle

转载 作者:行者123 更新时间:2023-12-03 03:15:16 25 4
gpt4 key购买 nike

我以前使用过 Maven 几次,但我是 Gradle 新手。我在 Mac OS X 10.10.1 上使用 Intellij IDEA 14.0.2。我也安装了带有导轨的 ruby 。 “gem update”显示我有最新的。
我还安装了 brew & oh_my_zsh 和最新版本。

好的,回到我的问题。我的目的是将一个小项目从 Maven 更改为 Gradle。我用 IDEA 为 Gradle 创建了一个新模块:
apply plugin: 'java'sourceCompatibility = 1.5version = '1.0'repositories { mavenCentral()}dependencies { testCompile group: 'junit', name: 'junit', version: '4.11'}
运行时的输出为:
/bin/bash /Users/lucianirimie/BCD/bcd-remote-tests/Gradle/build.gradlezsh:1: command not found: plugin:/Users/lucianirimie/BCD/bcd-remote-tests/Gradle/build.gradle: line 3: sourceCompatibility: command not found/Users/lucianirimie/BCD/bcd-remote-tests/Gradle/build.gradle: line 4: version: command not found/Users/lucianirimie/BCD/bcd-remote-tests/Gradle/build.gradle: line 6: repositories: command not found/Users/lucianirimie/BCD/bcd-remote-tests/Gradle/build.gradle: line 8: syntax error near unexpected token }'/Users/lucianirimie/BCD/bcd-remote-tests/Gradle/build.gradle: line 8: }'`

这是我的 .zshrc 文件的内容
# DISABLE_CORRECTION="true"# Uncomment following line if you want red dots to be displayed while waiting for completion# COMPLETION_WAITING_DOTS="true"# Uncomment following line if you want to disable marking untracked files under# VCS as dirty. This makes repository status check for large repositories much,# much faster.# DISABLE_UNTRACKED_FILES_DIRTY="true"# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/# Example format: plugins=(rails git textmate ruby lighthouse)plugins=(git)source $ZSH/oh-my-zsh.sh# Customize to your needs...export PATH=$PATH:/Users/lucianirimie/.rvm/gems/ruby-2.0.0-p247/bin:/Users/lucianirimie/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/lucianirimie/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/lucianirimie/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/binexport PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scriptingexport PATH="/usr/local/bin:$PATH"[[ -s酿造--前缀/etc/autojump.sh ]] && .酿造--前缀/etc/autojump.sh# Set name of the theme to load.# Look in ~/.oh-my-zsh/themes/# Optionally, if you set this to "random", it'll load a random theme each# time that oh-my-zsh is loaded.ZSH_THEME="robbyrussell"# Example aliases# alias zshconfig="mate ~/.zshrc"# alias ohmyzsh="mate ~/.oh-my-zsh"# Set to this to use case-sensitive completion# CASE_SENSITIVE="true"# Uncomment this to disable bi-weekly auto-update checks# DISABLE_AUTO_UPDATE="true"# Uncomment to change how often before auto-updates occur? (in days)# export UPDATE_ZSH_DAYS=13# Uncomment following line if you want to disable colors in ls# DISABLE_LS_COLORS="true"# Uncomment following line if you want to disable autosetting terminal title.# DISABLE_AUTO_TITLE="true"# Uncomment following line if you want to disable command autocorrection# DISABLE_CORRECTION="true"# Uncomment following line if you want red dots to be displayed while waiting for completion# COMPLETION_WAITING_DOTS="true"# Uncomment following line if you want to disable marking untracked files under# VCS as dirty. This makes repository status check for large repositories much,# much faster.# DISABLE_UNTRACKED_FILES_DIRTY="true"# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/# Example format: plugins=(rails git textmate ruby lighthouse)plugins=(git)source $ZSH/oh-my-zsh.sh# Customize to your needs...export PATH=$PATH:/Users/lucianirimie/.rvm/gems/ruby-2.0.0-p247/bin:/Users/lucianirimie/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/lucianirimie/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/lucianirimie/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/binexport PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scriptingexport PATH="/usr/local/bin:$PATH"[[ -s酿造--前缀/etc/autojump.sh ]] && .酿造--前缀/etc/autojump.sh

最佳答案

执行 Gradle 构建需要安装 Gradle,或使用 Gradle 包装器。看看Gradle docs有关安装说明。我相信 Gradle 也可以通过 Brew 获得。与 gradle命令在您的路径上正确注册,您将像这样构建您的项目(从带有 build.gradle 文件的文件夹中。

$ gradle build

关于intellij-idea - zsh "command not found: plugin:"用于 build.gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27925662/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com