带有Roo和Maven的STS Spring - 太慢了? [英] STS Spring with Roo and Maven - too slow?

查看:103
本文介绍了带有Roo和Maven的STS Spring - 太慢了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用STS和Java一段时间来开发Web应用程序。该项目配置为使用Maven,Roo和MySQL作为数据库。我经常发现在以下情况下我浪费了很多时间:

I am using STS and Java since a while for developing a web application. The project is configured for using Maven, Roo and MySQL as database. I often find that I waste a lot of time in the following cases:


  1. 没有Roo回复 - 当我修改域对象Java类时,即使项目的Roo shell打开并加载它也不会响应。我目前对这个问题的攻击是使用roo为类生成一个新的查找程序(以某种方式唤醒Roo)。有没有更好的黑客?

  1. No Roo response - when I modify a domain object Java class even if the Roo shell for the project is open and loaded it would not respond. My current hack to this issue is to generate a new finder for the class using roo (which awakens Roo somehow). Is there any better hack?

编译时间长 - 我已自动将构建设置为项目选项。也许我不应该使用它。但最重要的是,有时我需要在域对象中做一个小的更改,然后运行项目,因此我需要再次构建项目并测试它(即使是小的更改)。是否有任何属性可以配置为仅重新编译项目的某些部分?

Long times to compile - I have set build automatically on as a project option. Perhaps I should not use it. But the bottom line is that sometimes I need to do a small change in a domain object and then run the project hence I need to build the project again and test it (even for small changes). Is there any properties that I can configure to re-compile only some parts of the project?

Maven和Pom - 每当我修改 pom中的依赖项时,我经常发现Maven出现问题.xml 文件并保存,同时忘记在内部公司网络上 .m2 库将无法正确更新。在这些情况下,我应该在保存 pom.xml 之前切换到非内部网络。 恼人的位是,一旦我然后更改网络首选项并运行更新所有maven依赖项命令,它将无法正常执行。原因是生成了新库的pom文件,但错误消息为内容。问题似乎是Maven生成这些文件,但后来不够聪明,无法识别它们并尝试从Web存储库中再次获取库。要解决这个问题,我需要删除文件夹的内容并再次运行命令。 是否有人找到了更好的解决方案?

Maven and Pom - I often found problems with Maven as whenever I was modifying a dependency in pom.xml file and saving it whilst forgetting to be on an internal company network the .m2 library would not be updated correctly. In those cases I should have switched to a non internal network before saving the pom.xml. The annoying bit is that once I then change the network preferences and run the "update all maven dependencies" command, it would not do it properly. The reason is that the pom files for the new library are generated but with an error message as content. What the problem seem to be is that Maven generates these files but then is not clever enough to recognize them and try to fetch again the libraries from the web repositories. To fix this I need to delete the content of the folder and run the command again. Is there anyone that has found a better solution?

Roo真的吗?值得?如果是这样的话?

我发现Roo很适合入门并创建初始数据库和项目配置(例如安全性)。但是之后?到目前为止,我一直在使用Roo生成查找程序,但我经常发现,当一个新的查找程序添加到一个类时,Roo需要大约10/15分钟更新(我们的项目非常大)。我正在考虑开始大部分时间关闭Roo shell并在 .aj 文件中手动添加查找器并注释 .java 自己提交。之后是否会与Roo发生冲突(例如,一旦我因其他原因打开Roo shell)?

I found that Roo is good to get started and to create the initial database and project configurations (e.g. security). But then? By far I have been using Roo to generate finders but I often find that it takes about 10/15 minutes to Roo to update when a new finder is added to a class (our project is quite big). I am considering starting to keep the Roo shell closed most of the times and manually add the finders in the .aj files and annotate the .java file myself. Will this conflict with Roo afterwards (e.g. once I open the Roo shell for some other reason)?

Java和STS

为什么项目需要这么长时间才能编译?我的意思是,我想STS正在检查每个类中是否与最近修改的文件没有依赖关系,如果有更新代码并重新生成一个jar文件。它是否正确?如果我使用PHP或Python怎么办?会发生同样的事情还是会更快?我知道有几个讨论,但是当我列出我遇到的问题时,我想我也会提到这个问题。是使用哪种语言和使用哪种语言的永恒问题。在我们的例子中,我们有一个关系数据库,大量数据,安全约束,需要进行精确计算(需要严格的数据类型)。

Why does the project take so long to compile? I mean, I imagine that STS is checking that in every single class there is no dependency with the recently modified files and if there is one updates the code and regenerates a jar file. Is this correct? What if I was using PHP or Python? Would the same happen or would be faster? I know there are several discussions on this but as I am listing the issues I am having I thought I would mention this as well. Is the eternal question of which language to use and for what. In our case we have a relational database, huge amount of data, security constraints, and need to do precise computations (strict data typing needed).

推荐答案

1。确保Roo指向正确的目录:首选项,Spring,Roo支持

1. Ensure the Roo is pointing to the correct directory: Preferences, Spring, Roo Support

2。编译时间通常会通过验证加剧:首选项,验证,检查暂停所有验证器首选项,Spring,取消选中不需要的验证规则首选项,常规,构建,取消选中构建,然后在需要时手动构建

2. Compile times are often compounded by validation: Preferences, Validation, check Suspend all validators Preferences, Spring, uncheck unwanted validation rules Preferences, General, Build, uncheck build automatically, then manually build when needed

3。通过右键单击项目来更新依赖关系:Maven,更新依赖关系和更新项目配置

3. Update dependencies by right clicking on the project: Maven, Update Dependencies and Update Project Configuration

我写的DZone RefCard中有一些提示。 http://refcardz.dzone.com/refcardz/eclipse-tools-spring

Some tips are in the DZone RefCard I wrote. http://refcardz.dzone.com/refcardz/eclipse-tools-spring

问候,Gordon Dickens

Regards, Gordon Dickens

  • twitter.com/gdickens
  • linkedin.com/in/gordondickens
  • Blog: technophile.gordondickens.com
  • Free DropBox: http://db.tt/aJQFTac

这篇关于带有Roo和Maven的STS Spring - 太慢了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆