raonirenosto
raonirenosto

Reputation: 1515

Command grails war from outside project directory

Is there a way to call grails war from outside the project directory? My project path is "d:/deploy/project". I want some how pass my project directory to the compiler. Something like this: grails d:/deploy/project war.

I built ant ant script that is called from a batch file, so the batch starts in d:. So when the ant task is executed

I receive an error. Is there any way to do that?

Upvotes: 0

Views: 1675

Answers (2)

raonirenosto
raonirenosto

Reputation: 1515

I had to do a work around. I modified my ant script. The first thing the script should do is create a temporary dir and copy everything that is needed to that folder. Grails project, flex project and the build.xml ant file itself. After this initial process, I call the ant file in the temporary dir. As everything I need is in the same folder (including the ant script), I can call grails war command successfully. I'm not happy or proud working this way, but it seems the only one.

Upvotes: 1

Bill
Bill

Reputation: 211

AFAIK, no. The docs don't indicate a way to do it that I've found, and the output from the 'grails' command indicates that 'war' isn't supported outside a project, even if you try and pass in grails.project.class.dir

>grails dev war /tmp/foo.war -Dgrails.project.class.dir=/tmp/MyGrailsProject
Configuring classpath
Error /home/someuser does not appear to be part of a Grails application.
Error The following commands are supported outside of a project:
    add-proxy
    clear-proxy
    create-app
    create-plugin
    help
    list-plugins
    package-plugin
    plugin-info
    remove-proxy
    set-proxy

So you'd need some way to change your current working dir as part of your build process.

Upvotes: 2

Related Questions