Spring Roo 2.0.0.RC1 不知道自己的版本号

Spring Roo 2.0.0.RC1 doesn't know its own version number

当我启动 roo.sh 时,该命令记录了很多关于库版本和 Roo 版本的错误:

$ /opt/apps/ggg/spring-roo-2.0.0.RC1/bin/roo.sh
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: com.github.antlrjavaparser.antlr-java-parser:1.0.15
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.apache.commons.codec:1.8.0
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.apache.commons.io:2.4.0
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.apache.commons.lang3:3.1.0
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.fusesource.jansi:1.6.0
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.jsoup:1.9.1
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.apache.aries.subsystem.api:2.0.8
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.apache.aries.subsystem.core:2.0.8
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.apache.aries.util:1.1.1

...更多 "Auto-deploy" 警告,最后 ...

            _                               
 ___ _ __  _ __(_)_ __   __ _   _ __ ___   ___  
/ __| '_ \| '__| | '_ \ / _` | | '__/ _ \ / _ \ 
\__ \ |_) | |  | | | | | (_| | | | | (_) | (_) |
|___/ .__/|_|  |_|_| |_|\__, | |_|  \___/ \___/ 
    |_|                 |___/    UNKNOWN VERSION

Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo> 

如果我创建一个项目,Spring Roo 在创建的 pom.xml 文件中的版本是 UNKNOWN VERSION:

  <properties>
    <roo.version>UNKNOWN VERSION</roo.version>

然后,如果我修复文件设置 2.0.0 RC1 版本,当我再次启动 Roo 控制台时,它会显示:

...
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: org.springframework.roo.wrapping.snakeyaml:1.15.1
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: slf4j.api:1.7.12
Auto-deploy install: org.osgi.framework.BundleException: Bundle symbolic name and version are not unique: slf4j.jdk14:1.7.12
                _                               
 ___ _ __  _ __(_)_ __   __ _   _ __ ___   ___  
/ __| '_ \| '__| | '_ \ / _` | | '__/ _ \ / _ \ 
\__ \ |_) | |  | | | | | (_| | | | | (_) | (_) |
|___/ .__/|_|  |_|_| |_|\__, | |_|  \___/ \___/ 
    |_|                 |___/    UNKNOWN VERSION

Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
WARNING: You are using Spring Roo UNKNOWN VERSION, but project was generated using Spring Roo 2.0.0 RC1.
If you continue with the execution your project might suffer some changes.
Do you want to continue opening Spring Roo Shell?(YES/No)

如何解决版本问题?有没有我可以设置版本号的文件?

我看到您正在以下文件夹中执行 roo.sh 脚本:

/opt/apps/ggg

您对该文件夹有管理员权限吗?您可以尝试在 ~/apps/ggg 文件夹中执行 roo.sh 脚本吗?

如果对你有帮助,请告诉我。

此致

我发现了问题:SpringRoo 使用包含已知其自身版本的文件夹的名称。将文件夹 /opt/apps/ggg/roo 重命名为 /opt/apps/ggg/spring-roo-2.0.0.RC1 后按预期工作。

我知道从http://projects.spring.io/spring-roo/下载的分发文件中原来的名字是spring-roo-2.0.0.RC1(解压后改名成/opt/apps/ggg),没想到Spring 使用文件夹名称知道版本,老实说,我从未见过这样的行为,但重命名文件夹名称解决了问题。

感谢您的帮助。