Spring roo 1.1.0安裝試用

在我的gentoo裏試安裝roo,喜歡新東西,所以下的是開發版,1.1.0已經不需要ROO_HOME環境變量了

從spring下個zip包解壓出來就可以用了,看下面:

 

ben@ben ~
 $ ls /opt/java/spring-roo-1.1.0.M1/
annotations  bin  bundle  cache  conf  docs  legal  readme.txt  samples


不過全用時發現non-root用戶不能正常使用,報錯是roo目錄下的cache不能訪問,所以聯想到可能是文件系統訪問權限問題,如:

ERROR: Error creating archive. (java.io.FileNotFoundException: /opt/java/spring-roo-1.1.0.M1/cache/bundle22/version0.0/revision.location (Permission denied))
java.io.FileNotFoundException: /opt/java/spring-roo-1.1.0.M1/cache/bundle22/version0.0/revision.location (Permission denied)



我的解決辦法是:acl

當然你要知道什麼是acl,假設你知道了ACL

 

我在fstab的opt的defauilts後加上了acl(注意紅色部分)

 

ben@ben ~
 $ grep /opt /etc/fstab 
/dev/vg0/opt		/opt		ext3		defaults,acl
	1 2

 

順理成章當然要

 

sudo mount -o remount /opt

 

那麼...

 

ben@ben ~
 $ mount | grep opt
/dev/mapper/vg0-opt on /opt type ext3 (rw,acl
)

 

這樣就打開acl了

 

只要再

 

ben@ben ~
 $ sudo setfacl -d -m u:ben:rwx /opt/java/spring-roo-1.1.0.M1/cache/
ben@ben ~
 $ sudo setfacl -R -m u:ben:rwx /opt/java/spring-roo-1.1.0.M1/cache/

 

驗證一下

 

ben@ben ~
/workspace/rooweb $ getfacl /opt/java/spring-roo-1.1.0.M1/cache/
getfacl: Removing leading '/' from absolute path names
# file: opt/java/spring-roo-1.1.0.M1/cache/
# owner: root
# group: root
user::rwx
user:ben:rwx

group::r-x
mask::rwx
other::r-x
default:user::rwx
default:user:ben:rwx

default:group::r-x
default:mask::rwx
default:other::r-x

 

cache下的目錄應該也需要給ben以rwx權限

 

再執行一下roo就不會出錯了

 

ben@ben ~

/workspace/rooweb $

 roo 
    ____  ____  ____  
   / __ / __ / __  
  / /_/ / / / / / / / 
 / _, _/ /_/ / /_/ /  
/_/ |_|____/____/    1.1.0.M1 [rev 3a0b8a3]


Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.

roo> 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章