Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename an existing Grails application

Tags:

grails

Does anybody know how to (easily) "rename" an existing grails application? I'm running into this because my PaaS provider does not allow me to delete a subscription... So I want to deploy my application under a different name.

Of course, I can do this manually, but I think it might be a useful 'top-level' script (i.e. "grails rename-app newappname")

Manual hints:

When I do a "grails create-app myappname" I can see the myappname exists in the following files (and filenames)... Of course this is done by the create-app script, which replaces @...@ tokens in the template. I guess once they are replaced, it's not trivial to do a rename.

./.project: <name>myappname</name>
./application.properties:app.name=myappname
./build.xml:<project xmlns:ivy="antlib:org.apache.ivy.ant" name="myappname" default="test">
./ivy.xml:    <info organisation="org.example" module="myappname"/>
./myappname-test.launch:<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="myappname"/>
./myappname.launch:<listEntry value="/myappname"/>
./myappname.launch:<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="myappname" path="1" type="4"/> "/>
./myappname.launch:<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="myappname"/>
./myappname.launch:<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir="${project_loc:myappname}" -Dserver.port=8080 -Dgrails.env=development"/>
./myappname.tmproj: <string>myappname.launch</string>

And of course... the top-level directory name is "myappname"

Any hints, or information about ongoing initiatives in this area are welcome

Greetz,

Johan

like image 381
Johan Pelgrim Avatar asked May 07 '09 09:05

Johan Pelgrim


1 Answers

I had to do this, I renamed my project top level directory to the new name and edited the application.properties file. There is a line app.name=youroldappname which should be changed.

Actually, you do not even have to rename the directory. You could have a different web-app name.

like image 136
Sean A.O. Harney Avatar answered Sep 25 '22 18:09

Sean A.O. Harney