How to create my first Grails project in IntelliJ with Maven?

  • Goal : Create my first Grails project in IntelliJ with Maven support.
  • : Noob Groovy / Grails, has some Maven experience, but not too much
  • Tool : Groovy 1.7.5, IntelliJ 9.0.3, and Maven 2.0

I have tried so far:

  • File-> New Project
  • Create module
  • Maven module
  • Add and Select Architect Grails
  • Right click on project -> Run -> grails

I get errors:

  • PHP home is not specified - WTF, is Grails PHP needed?
  • When I previously tried to use IntelliJ to create a Grails project without Maven, I really managed to run the application, so I don’t understand what is missing right now.

PS I reported this as a problem , vote if you want.

- , github .

+3
3

IntelliJ .

( , 1.3.4):

:

mvn archetype:generate -DarchetypeGroupId=org.grails \
    -DarchetypeArtifactId=grails-maven-archetype \
    -DarchetypeVersion=1.3.4 \
    -DgroupId=example -DartifactId=my-app

my-app/pom.xml, Java 6:

  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
  </plugin>

cd my-app ( maven ):

cd my-app
mvn initialize

application.properties, :

plugins.hibernate=1.3.4
plugins.tomcat=1.3.4

:

mvn compile

,

mvn grails:run-app

http://localhost:8080/my-app/.

, IntelliJ . , , , , IntelliJ.

+4

user495750. IntelliJ 9. , ( , Ripper234 ). Grails, Grails 1.2.0 1.3.5, IntelliJ . PHP. , . , Intellij Grails . Maven. . BTW: 1.3.6 Hudson - YUI. . → Grails.. → SDK → Grails Home. , Grails . .

+1

Grails does not require PHP. You got this error because you created the PHP startup configuration, and Grails runs the configuration. The PHP launch configuration can be created in the any project by right-clicking on the project → Run → ProjectName. This is a problem with PHP support. The Grails launch configuration will be created automatically after initializing the project structure.

0
source

Source: https://habr.com/ru/post/1770963/


All Articles