Grailsインストール

ソフトウェアバージョン

  • OS: CentOS 7.0 (64bit)
  • Java SDK: Java8
  • Groovy: GRAILSに同梱のもの 1.7.8
  • GRAILS: Grails tool suite 3.6.4 
Java SDK
# rootユーザで実施

####
#### RPM版をインストール
####
# JavaSDK: /usr/java/jdk1.8.0_65 にインストールされる
####
#### 環境変数 JAVA_HOME 設定
####
echo "export JAVA_HOME=/usr/java/default" > /etc/profile.d/java.sh
GRAILS
# rootユーザで実施 (一般ユーザの方がいいのか?)

####
#### インストール
####
# ディレクトリ作成
mkdir /opt/grails
cd /opt/grails
# 解凍
unzip /root/grails-1.3.7.zip
# リンク作成
ln -s grails-1.3.7 default

####
#### 環境変数 GRAILS_HOME 設定
####
GRAILS_HOME=/opt/grails/default
PATH=$GRAILS_HOME/bin:$PATH 
export PATH 
 
 ####
#### 動作確認
####
# ログインしなおして環境変数を反映してから・・・
grails

# 下記が出力されればよい
#    Welcome to Grails 1.3.7 - http://grails.org/
#    Licensed under Apache Standard License 2.0
#    Grails home is set to: /opt/grails/default
#
#    No script name specified. Use 'grails help' for more info or 'grails interactive' to enter interactive mode
 
 
GRAILSアプリの生成
# GRAILSのアプリを入れるディレクトリを作成 
mkdir /grails  
# GRAILSのアプリ生成  
cd /grails grails create-app my-project 
# 下記が出力されればよい  
# Welcome to Grails 1.3.7 - http://grails.org/ # Licensed under Apache Standard License 2.0 # Grails home is set to: /opt/grails/default 
#  
# Base Directory: /grails 
# Resolving dependencies... 
# Downloading: /opt/grails/default/lib/gpars-0.9.jar ... 
# Download complete.  
#  
# ・・・(中略)・・・  
# 
# Installed plugin tomcat-1.3.7 to location /root/.grails/1.3.7/projects/my-project/plugins/tomcat-1.3.7. ... 
# Executing tomcat-1.3.7 plugin post-install script ... 
# Plugin tomcat-1.3.7 installed 
# Plugin provides the following new scripts: 
# ------------------------------------------ 
# grails tomcat # Created Grails Application at /grails/my-project


生成後のディレクトリ構成
 
/grails
└── my-project
    ├── grails-app
    │   ├── conf
    │   │   ├── hibernate
    │   │   └── spring
    │   ├── controllers
    │   ├── domain
    │   ├── i18n
    │   ├── services
    │   ├── taglib
    │   ├── utils
    │   └── views
    │       └── layouts
    ├── lib
    ├── scripts
    ├── src
    │   ├── groovy
    │   └── java
    ├── test
    │   ├── integration
    │   └── unit
    └── web-app
        ├── css
        ├── images
        │   └── skin
        ├── js
        │   └── prototype
        ├── META-INF
        └── WEB-INF
            └── tld

コメント

人気の投稿