简体   繁体   English

蚂蚁部署问题

[英]ant deployment issues

i am looking to make our deployments here not suck and i need some help, if you can help me with these few things i owe you beer 我希望不让我们的部署在这里烂摊子,我需要一些帮助,如果您能在这几件事上为我提供帮助,我欠您啤酒

right now whenever i make a change thats not to the jsps i need to clean-including-tomcat otherwise my change doesnt take. 现在,每当我对jsps进行更改时都不需要清理,包括totomcat,否则我的更改不会生效。 this is really annoying. 这真烦人。

any clues as to what i can change to make it work? 关于我可以更改使其工作的任何线索?

my current build is really simple, just the regular old, javac, war, deploy one thing that isnt done is that there is no build dir, the project itself contains a web-inf and the javac is done in place, then the war excludes all the .java resources and wars the project. 我当前的构建非常简单,只是常规的旧版本,javac,war,部署未完成的一件事是没有构建目录,项目本身包含一个web-inf,javac已就位,所以战争排除在外所有.java资源并警告该项目。

edit: I am looking to fix this problem with least amount of effort - so while switching to maven and learning how to use it might solve this problem, but it will create another problem ;) 编辑:我正在寻找以最小的努力解决此问题-因此,当切换到Maven并学习如何使用它可能会解决此问题,但它将创建另一个问题;)

You've already identified some of the weaknesses, in your current build. 您已经确定了当前版本中的一些弱点。
The easiest way that I can suggest to clean it up would be to start with the directory structure. 我建议清理的最简单方法是从目录结构开始。

I highly recommend using the maven directory structure , I would go further to suggest using maven as a build tool instead of ant, however for some folk that remains open for debate. 我强烈建议使用maven目录结构 ,我将进一步建议使用maven作为构建工具而不是ant,但是对于某些尚有争议的人们。
The maven directory structure has been well thought out, I really like working on projects that use the maven directory structure, because they follow a convention that allows me to save a lot of time, by knowing from previous experience where to find the application components Maven目录结构已经过深思熟虑,我真的很喜欢使用maven目录结构的项目,因为它们遵循的约定使我从以前的经验中知道可以在哪里找到应用程序组件,从而节省了很多时间。

  • java source Java源
  • unit test source 单元测试源
  • resources etc. 资源等

Also by following the convention, the maven plugins work with less configuration required. 同样通过遵循约定,maven插件可以使用较少的配置工作。

Another useful advantage that I get from working on maven based projects is good code metrics, to measure the health of the application. 我从基于Maven的项目中获得的另一个有用的好处是良好的代码指标,可以衡量应用程序的运行状况。 There are various report available as maven plugins, which will give you new insight into your codebase, including: 有作为maven插件提供的各种报告,这些报告将使您对代码库有新的了解,包括:

  • checkstyle 格斗风格
  • pmd PMD
  • findbugs 虫子
  • and more. 和更多。

Created a build directory where everything got copied before build 创建一个构建目录,所有内容在构建之前都已复制

Added some flags to not copy over things that rarely change, like images (also to not remove them on clean) 添加了一些标志以不复制很少更改的内容(例如图像)(也不要将它们清除干净)

Started using ant-reload task after deploying code 部署代码后开始使用ant-reload任务

Now i don't need to restart tomcat on every build, and build takes much less time. 现在,我不需要在每个版本上都重新启动tomcat,并且构建所需的时间要少得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM