Grails 3和IntelliJ无法启动项目 [英] Grails 3 and IntelliJ Unable to start project

查看:72
本文介绍了Grails 3和IntelliJ无法启动项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在甚至都不知道从哪里开始.我已经安装了grails 3.2.4,正在使用IntelliJ IDEA Ultimate 2016.1.我可以使用grails-3.2.4创建一个新的grails项目,它似乎成功了,Grails控制台显示create-app成功.创建项目,并打开一个IDEA窗口,但显示以下消息:

Not even sure where to start at this point. I've installed grails 3.2.4 I'm using IntelliJ IDEA Ultimate 2016.1. I can create a new grails project using grails-3.2.4 and it appears to succeed, the Grails Console shows the create-app was successful. The project creates and an IDEA window opens, but displays the message:

Gradle 'myProject' project refresh failed
    Error: Cause: unable to find valid certification path to requested target

我不知道此错误来自何处或如何指定密钥库.如果我进入项目目录(〜/myProject)并尝试从命令行运行grails,它会尝试在出现以下错误之前启动:

I have no idea where this error comes from or how to specify a keystore. If I go into the project directory (~/myProject) and attempt to run grails from the command line, it attempts to start before erroring out with:

 Error Error initializing classpath: Operation timed out 

我尝试将代理信息添加到gradle.properties文件中:

I tried adding proxy information to the gradle.properties file:

systemProp.http.proxyHost=proxy-server.company.com
systemProp.http.proxyPort=80

这似乎没有效果.

除了最初的grails控制台输出外,IntelliJ中的项目似乎还没有grails支持...我无法右键单击以在该项目上创建新的Grails对象.工具"菜单没有"Grails"子菜单.运行配置不允许我选择要运行的grails项目.在这一点上,我只是在刺痛尝试创建一个新项目并在grails 3中运行.

The project in IntelliJ doesn't even seem to have grails support beyond the initial grails console output... I cannot right-click to create new Grails objects on the project. The "Tools" menu does not have a "Grails" sub-menu. Run configurations do not allow me to select a grails project to run. I'm at this point I'm just stabbing at things trying to get a new project created and running in grails 3.

更新:通过下载gradle-version-bin.zip文件并从 gradle引用它,我克服了最初的找不到证书路径错误.-wrapper.properties 在本地而不是在外部分发URL处尝试使用开箱即用.这似乎允许它尝试更新,但是由于错误而超时

Update: I got past the initial unable to find certification path error by downloading the gradle-version-bin.zip file and referencing it from the gradle-wrapper.properties locally instead of at the external distribution URL it tries to use out-of-the box. This seems to allow it to try to update, but times out with the error

Operation timed out.  If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

我的IDE代理设置使用自动代理配置URL(通过在首选项窗口中运行检查连接"来确认)是正确的(首选项->外观->系统设置-> HTTP代理).如我上面所说,还尝试将proxyHost添加到 gradle.properties 中.不过,似乎该更新未使用代理.

My IDE proxy settings are correct (Preferences --> Appearance --> System Settings --> HTTP Proxy) using an Automatic proxy configuration URL (as confirmed by running "Check Connection" from the preferences window). Also tried adding the proxyHost to gradle.properties as I said above. It seems that the update is not using the proxy, though.

更新2 :在手动下载gradle并在本地安装了gradle之后,我最终将 build.gradle 中的maven存储库URL更新为使用http而不是https.完成此操作后,便可以在gradle窗口中刷新项目.完成此操作后,gradle视图最终显示有一个项目,并且grails命令可用.

Update 2: After getting gradle downloaded manually and installed locally, I eventually updated the maven repository URLs in build.gradle to use http instead of https. Once I did this, I was able to refresh the project in the gradle window. After this finished, the gradle view finally showed that there was a project and grails commands were available.

不太了解证书,但是我认为我应该能够从安全存储库下载依赖项.

Not too savvy with certificates, but I think I should be able to download dependencies from secure repositories.

推荐答案

使用 grails create-app name 创建项目后,需要将项目导入intellij idea.打开IDE,从现有来源转到文件->新建->项目.然后在生成的项目中选择 build.gradle 文件.点击确定.

After you created the project using grails create-app name, you need to import the project to intellij idea. Open IDE go to file->new->project from existing sources. Then select the build.gradle file in your generated project. Click ok.

这会将grails项目导入到您的IDE中.

this will import the grails project into your IDE.

运行grails项目,右键单击 grails-app/init/$ {projectName}/Application.groovy ,然后单击运行Application .

to run grails project, right click on grails-app/init/${projectName}/Application.groovy and click on run Application.

你很好走.

如果IDE无法识别您的grails,请转到工具-> grails->更改SDK版本->将grails的安装路径放在此处.

If IDE is not recognizing your grails then go to tools -> grails -> change sdk version -> put the grails installation path there.

这篇关于Grails 3和IntelliJ无法启动项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆