我无法向ROO 2.0.0.M3添加新语言

时间:2017-03-02 05:29:38

标签: spring-roo

嗨我安装新语言也有问题。

构建新的邮件属性文件 我在roo shell中使用messages_de.properties创建了语言插件。

addon create i18n --topLevelPackage org.springframework.roo.addon.web.mvc.i18n --locale de --messageBundle messages_de.properties

我将用maven创建一个jar

mvn clean install

第一个问题

Downloading: https://repo.maven.apache.org/maven2/org/springframework/roo/org.springframework.roo.ad
don.web.mvc.jsp/2.0.0.M3/org.springframework.roo.addon.web.mvc.jsp-2.0.0.M3.pom
[WARNING] The POM for org.springframework.roo:org.springframework.roo.addon.web.mvc.jsp:jar:2.0.0.M3
 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/org/springframework/roo/org.springframework.roo.ad
don.web.mvc.jsp/2.0.0.M3/org.springframework.roo.addon.web.mvc.jsp-2.0.0.M3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.043 s
[INFO] Finished at: 2017-03-02T07:08:50+01:00
[INFO] Final Memory: 12M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.springframework.roo.addon.web.mvc.i18n.languages: Coul
d not resolve dependencies for project org.springframework.roo.addon.web.mvc.i18n.languages:org.spri
ngframework.roo.addon.web.mvc.i18n.languages:bundle:0.1.0.BUILD-SNAPSHOT: Could not find artifact or
g.springframework.roo:org.springframework.roo.addon.web.mvc.jsp:jar:2.0.0.M3 in central (https://rep
o.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following arti
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我在maven存储库上显示,只有ROO 2.0.0.M1的jar,我使用M3 然后我改变了pom.xml集

<dependency>
   <groupId>org.springframework.roo</groupId>
   <artifactId>org.springframework.roo.addon.web.mvc.jsp</artifactId>
   <version>2.0.0.M1</version>
</dependency>

一个罐子正在建造。

我将这个jar安装为插件。

我已经在启动roo的文件夹中复制了jar。 我在Windows上工作。 但命令不起作用

在roo shell类型

我测试 addon install url --url file:\\ org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD -SNAPSHOT.jar

堆栈跟踪:

Illegal character in opaque part at index 5: file:\org.springframework.roo.addon.web.mvc.i18n.langua
ges-0.1.0.BUILD-SNAPSHOT.jar
java.lang.IllegalArgumentException: Illegal character in opaque part at index 5: file:\org.springfra
mework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at java.net.URI.create(Unknown Source)
    at java.net.URI.resolve(Unknown Source)
    at org.apache.felix.gogo.command.Util.resolveUri(Util.java:522)
    at org.apache.felix.gogo.command.Basic.install(Basic.java:433)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:110)
    at org.springframework.roo.felix.FelixDelegator.shell(FelixDelegator.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.obr.addon.search.ObrAddonSearchOperationsImpl.installAddOnByUrl(ObrAd
donSearchOperationsImpl.java:457)
    at org.springframework.roo.obr.addon.search.ObrAddOnCommands.installByUrl(ObrAddOnCommands.java:
46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:417)
    at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:547)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 5: file:\org.sprin
gframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at java.net.URI$Parser.fail(Unknown Source)
    at java.net.URI$Parser.checkChars(Unknown Source)
    at java.net.URI$Parser.parse(Unknown Source)
    at java.net.URI.<init>(Unknown Source)
    ... 43 more
org.osgi.framework.BundleException: Unable to cache bundle: file:\org.springframework.roo.addon.web.
mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2975)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:140)
    at org.apache.felix.gogo.command.Basic.start(Basic.java:734)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:110)
    at org.springframework.roo.felix.FelixDelegator.shell(FelixDelegator.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.obr.addon.search.ObrAddonSearchOperationsImpl.installAddOnByUrl(ObrAd
donSearchOperationsImpl.java:458)
    at org.springframework.roo.obr.addon.search.ObrAddOnCommands.installByUrl(ObrAddOnCommands.java:
46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:417)
    at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:547)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: \org.springframework.roo.addon.web.mvc.i18n.languages-0.1.
0.BUILD-SNAPSHOT.jar (Das System kann die angegebene Datei nicht finden)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:52
5)
    at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
    at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:77)
    at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:
878)
    at org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
    at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
    at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2971)
    ... 42 more
java.io.FileNotFoundException: \org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNA
PSHOT.jar (Das System kann die angegebene Datei nicht finden)

为什么在最后找到文件未找到异常有什么问题?

我测试 addon install url --url file://org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD -SNAPSHOT.jar

并获取stacktrace:

java.io.IOException: Server returned HTTP response code: 503 for URL: ftp://org.springframework.roo.
addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar

org.osgi.framework.BundleException: Unable to cache bundle: file://org.springframework.roo.addon.web
.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2975)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:140)
    at org.apache.felix.gogo.command.Basic.start(Basic.java:734)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:110)
    at org.springframework.roo.felix.FelixDelegator.shell(FelixDelegator.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.obr.addon.search.ObrAddonSearchOperationsImpl.installAddOnByUrl(ObrAd
donSearchOperationsImpl.java:458)
    at org.springframework.roo.obr.addon.search.ObrAddOnCommands.installByUrl(ObrAddOnCommands.java:
46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:417)
    at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:547)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: ftp://org.springfra
mework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
    at org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:52
5)
    at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
    at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:77)
    at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:
878)
    at org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
    at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
    at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2971)
    ... 42 more
java.io.IOException: Server returned HTTP response code: 503 for URL: ftp://org.springframework.roo.
addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar

我想我不能用addon install url安装插件--url文件:\ ...或者用file:// ... 文件在此命令中不起作用。 我使用osgi命令的旧版本Roo我找到了osgi start的例子--url file:///foo.jar

http://docs.spring.io/spring-roo/reference/html/simple-addons.html

但osgi命令不起作用或找不到。

另一个问题我测试使用osgi命令安装(比如来自roo的旧版本),但找不到osgi命令。

我输入

roo> help osgi

COMMAND INDEX


** Type 'hint' (without the quotes) and hit ENTER for step-by-step guidance **

roo> osgi start --url file:///org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPS
HOT.jar
Command 'osgi start --url file:///org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-S
NAPSHOT.jar' not found (for assistance press TAB or type "hint" then hit ENTER)
Searching 'osgi start' on installed repositories
0 matches found with 'osgi start' on installed repositories

另一种语言测试 我在与org.springframework.roo.addon.web.mvc.i18n-2.0.0.M3.jar相同的包结构中添加了构建语言,并将gramen的构建类,消息属性和图像放在另一个jar中语言存在。当我在现有项目中键入web mvc language --code时,这不适用于新语言。

1 个答案:

答案 0 :(得分:0)

对不起我的延迟回答。我正在检查你的问题,知道哪个是问题。

关于编译问题,我刚刚在下面的提交中解决了它。

https://github.com/spring-projects/spring-roo/commit/2a332a991e16796c38180213d75666f41e6b1b86

此修复程序将包含在将于本周发布的Spring Roo 2.0.0.RC1版本中。

关于新.jar的安装过程,您应该使用以下命令:

roo> addon install url --url file:///home/jcagarcia/.m2/repository/org/jcagarcia/i18n/de/org.jcagarcia.i18n.de/0.1.0.BUILD-SNAPSHOT/org.jcagarcia.i18n.de-0.1.0.BUILD-SNAPSHOT.jar
Bundle ID: 92

如您所见,插件安装过程正常运行。

使用此命令时请记住以下提示:

  • 不要在创建addon language的同一文件夹下执行Spring Roo shell。
  • 您必须指明.jar文件的完整路径
    • Linux路径:file:///home/jcagarcia/.m2/repository/org/jcagarcia/i18n/de/org.jcagarcia.i18n.de/0.1.0.BUILD-SNAPSHOT/org.jcagarcia.i18n。脱0.1.0.BUILD-SNAPSHOT.jar
    • Windows路径:file:/// C://Users/jcagarcia/Desktop/org.jcagarcia.i18n.de-0.1.0.BUILD-SNAPSHOT.jar

希望它有所帮助!