我们一直在UNIX服务器上部署Play/Scala应用程序,只需运行可执行文件,例如
{
"apps": [{
"name": "JavaAgent",
"cwd": "/usr/bin",
"args": [
"-Xmx256m",
"-cp",
"/app/somedirectorywhereagentresides:/some/directory/where/your/classes/lives",
"your.main.class"
],
"env": {
"ANY_ENV_VARIABLE": "that you might need in your program"
},
"script": "java",
"node_args": [],
"log_date_format": "YYYY-MM-DD HH:mm Z",
"exec_interpreter": "none",
"exec_mode": "fork"
}
]
}
它工作正常。但是,对于我的NodeJS应用程序,我使用pm2,我非常感谢它的易用性和监控选项,因此也希望将它用于其他应用程序。
This thread声称可以运行JAR。关于如何调整conf(见下文)以使其与我的Play / scala应用程序一起使用以及是否可以使用它的任何想法?
使用pm2运行Jar:
Dim usernames() As String
Dim strSQL As String
Dim xlApp As Excel.Application
Dim xlWork As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim rst As Recordset
usernames() = Split(Users, ",")
strSQL = "SELECT tblPra.praNo, tblFolder.folder, tblFolder.fullTitle FROM "&_
"tblPra INNER JOIN (tblFolder INNER JOIN tblRelationship ON " &_
"tblFolder.folderID = tblRelationship.folderID) ON " &_
"tblPra.praID = tblRelationship.praID " &_
"WHERE (((tblPra.praNo) IN ('" & Join(usernames, "','") & "')));"
Set rst = CurrentDb.OpenRecordset(strSQL)
Set xlApp = CreateObject("Excel.Application")
Set xlWork = xlApp.Workbooks.Open("c:\temp\MyExcelTemplate.xlsx")
Set xlSheet = xlWork.Sheets("Sheet1")
xlSheet.Range("A1").CopyFromRecordset rst
答案 0 :(得分:3)
这是我项目中的一个工作示例。首先,您需要使用命令" activator dist"来准备您的项目。它生成独立版本并将其压缩为.ZIP文件。
{ "apps": [{ "name": "NameInPM2List", "cwd": "/path/to/your/project", "args": [ "-Duser.dir=/path/to/your/project", "-Dhttp.address=127.0.0.1", "-Dhttp.port=9000", "-cp", "/path/to/your/project/lib/*", "play.core.server.ProdServerStart" ], "script": "/usr/bin/java", "node_args": [], "log_date_format": "YYYY-MM-DD HH:mm Z", "exec_interpreter": "none", "exec_mode": "fork" } ] }
这就是全部。
答案 1 :(得分:1)
尝试将命令行参数放在"args"
下。
将conf
和lib
目录放在类路径上
Play的引导类是play.core.server.NettyServer
。