我正在尝试将我的Play框架应用的激活器启动器从较早版本更新为最新版本,我使用的版本从1.3.6到1.3.8,而运行以下命令没有任何问题:
ACTIVATOR_BIN_PATH> activator clean compile stage dist
但是我尝试使用最新版本1.3.10无法正常工作,其内容如下:
ACTIVATOR_HOME=[PROJECT_PATH]\play-java
The system cannot find the file [PROJECT_PATH]\play-java\bin\..\conf\sbtconfig.txt.
Did not detect an activator project in this directory.
- activator
Load an existing project (has to be executed from the project directory)
or print this help message if no project is found
Sub-commands
- activator ui
Open the project in the UI if executed from an existing project
directory, otherwise open a project-creation UI.
- activator new [project-name] [template-name]
Create a new project, prompting for project-name if missing and helping you
find a template if template-name is not provided.
- activator list-templates
Fetch the latest template list and print it to the console.
您可以下载激活器(1.3.8-minimal)和(1.3.10-minimal),以获得1.3.10 donwnload(scala-sbt),然后应用此处提供的修复程序:Warning message running Play 2.5.x
然后,您可以为两个激活器启动第一个项目:
activator new my-first-app play-java
我的plugin.sbt:
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.1")
addSbtPlugin("com.github.mmizutani" % "sbt-play-gulp" % "0.1.1")
最佳答案
现在,我找到了某种解决方案,将激活器从bin
文件夹移回了[PROJECT_PATH]并更改了几行
将BIN_DIRECTORY
和ACTIVATOR_HOME
的值更改为:
set BIN_DIRECTORY=%~dp0
set BIN_DIRECTORY=%BIN_DIRECTORY:~0,-1%
for %%d in (%BIN_DIRECTORY%) do set ACTIVATOR_HOME=%%~dpd
set ACTIVATOR_HOME=%ACTIVATOR_HOME:~0,-1%
至:
set BIN_DIRECTORY=%~dp0
set BIN_DIRECTORY=%BIN_DIRECTORY:~0,-1%
for %%d in (%BIN_DIRECTORY%) do set ACTIVATOR_HOME=%~dp0
set ACTIVATOR_HOME=%ACTIVATOR_HOME:~0,-1%
和
SBT_HOME
到:set SBT_HOME=%BIN_DIRECTORY%
和
FN
到:set FN=%SBT_HOME%\conf\sbtconfig.txt
对于Linux版本(bash),将
sbt_home
更改为此:declare -r sbt_home="$(realpath "$(dirname "$(realpath "$0")")")"
似乎现在可以正常工作了。
由于Linux版本似乎在bin内仍然可以正常运行,因此不确定是否有办法在不将激活器移出bin的情况下进行修复。
但是无论如何,这种解决方案现在仍然有效。