Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Grails 3 Project: Unable to Run Grails project

I recently installed IntelliJ onto my machine after many unsuccessful attempt to get GGTS working reliably. So far the error messages were clear and easy to resolve after I imported my Grails project. GGTS had forced me to downgrade from Grails 3 to 2 because, at the time, GGTS does not seem to support Grails 3. I ran into issues after pointing IntelliJ to Grails 3, but restarting IntelliJ seemed to fix those problems. Now, however, I can't get my project to start and I get the following error:

"C:\Program Files\Java\jdk1.8.0_51\bin\java" ...;C:\dev\grails-3.0.4\lib\xalan\serializer\jars\serializer-2.7.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.grails.cli.GrailsCli run-app
Error |
Problem updating profiles from origin git repository (Use --stacktrace to see the full trace)
Error |
Could not checkout tag for Grails release [3.0.4]: repository not found: C:\Users\Randeep\.grails\repository (Use --stacktrace to see the full trace)
Error |
Error occurred running Grails CLI: No profile found for name [web]. (Use --stacktrace to see the full trace)

Process finished with exit code 1

Note the "Problem updating profiles from origin git repository" message. This is a git project, but I don't know why IntelliJ is trying to do any git operations (I don't want it to, I just want it to run my project).

like image 951
IcedDante Avatar asked Nov 05 '15 13:11

IcedDante


2 Answers

There's a lot going on behind the scenes with grails here. The CLI (command line interface) is trying to load a profile called web. Basically grails creates a .grails folder in your home directory that contains a set of default profiles (see ~/.grails/repository/profiles).

Somehow this folder got corrupted or modified on my system and the web profile, which is the default profile, disappeared. To fix this I simply deleted the .grails folder from my home directory, ran grails, and it regenerated.

Edit: Deleting your .grails folder may have undesirable behavior if other projects are using data within it, so try deleting the profiles folder first.

like image 88
IcedDante Avatar answered Oct 24 '22 03:10

IcedDante


I got this error message too after I delete ~/.grails ~/.gradle from my home directory.

Thoses directories seems won't created again for some reason, and grails clean isn't work at the same time.

This how I fixed it, hope it helps.

  1. set up JAVA_HOME / GRAILS_HOME variables.
  2. cd GRAILS_HOME (ie. /etc/grails/grails-3.1.4 )
  3. execute 'bin/grails'
  4. create-profile web
  5. grails will try to create a new web profile, and start downloading dependency jars.
  6. exit. & done.

ps. my environment.

  • jdk 1.7.0_4
  • grails 3.1.4
like image 45
ressol Avatar answered Oct 24 '22 03:10

ressol