Ruby on rails 如何从Maven exec插件启动/停止Rails应用程序?

Ruby on rails 如何从Maven exec插件启动/停止Rails应用程序?,ruby-on-rails,shell,deployment,maven,exec,Ruby On Rails,Shell,Deployment,Maven,Exec,我正在尝试从Maven exec插件启动Rails应用程序。我正在使用/script/rails server启动服务器,并使用kill-9 cat tmp/pids/server.pid停止服务器。但exec在服务器启动后一直在等待。可以在后台运行这样的shell命令而不等待吗?有没有更好的方法从Maven启动/停止rails应用程序?以下是我的pom.xml: org.codehaus.mojo execmaven插件 1.1 启动rails应用程序 预集成测试 脚本/轨道 ${rail

我正在尝试从Maven exec插件启动Rails应用程序。我正在使用
/script/rails server
启动服务器,并使用
kill-9 cat tmp/pids/server.pid
停止服务器。但exec在服务器启动后一直在等待。可以在后台运行这样的shell命令而不等待吗?有没有更好的方法从Maven启动/停止rails应用程序?以下是我的pom.xml:


org.codehaus.mojo
execmaven插件
1.1
启动rails应用程序
预集成测试
脚本/轨道
${rails.app.dir}
服务器
执行官
停车轨应用程序
整合后测试
kill-9`cat tmp/pids/server.pid`
${rails.app.dir}
执行官

传递
-d
参数以作为守护进程启动服务器:
rails server-d

以下是
rails服务器
命令的详细信息:

rails server -h
Usage: rails server [mongrel, thin, etc] [options]
    -p, --port=port                  Runs Rails on the specified port.
                                     Default: 3000
    -b, --binding=ip                 Binds Rails to the specified ip.
                                     Default: 0.0.0.0
    -c, --config=file                Use custom rackup configuration file
    -d, --daemon                     Make server run as a Daemon.
    -u, --debugger                   Enable ruby-debugging for the server.
    -e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                     Default: development
    -P, --pid=pid                    Specifies the PID file.
                                     Default: tmp/pids/server.pid

    -h, --help                       Show this help message.
rails server -h
Usage: rails server [mongrel, thin, etc] [options]
    -p, --port=port                  Runs Rails on the specified port.
                                     Default: 3000
    -b, --binding=ip                 Binds Rails to the specified ip.
                                     Default: 0.0.0.0
    -c, --config=file                Use custom rackup configuration file
    -d, --daemon                     Make server run as a Daemon.
    -u, --debugger                   Enable ruby-debugging for the server.
    -e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                     Default: development
    -P, --pid=pid                    Specifies the PID file.
                                     Default: tmp/pids/server.pid

    -h, --help                       Show this help message.