我正在对 Share 开发和执行一些自定义。我的 IDE 是 Eclipse Juno,工作区由以下元素组成:
alfresco 和 share web 项目都部署在单独的 Tomcat 实例中,这样我可以通过仅重新启动部署了 Share 的 Tomcat 实例来稍微加快我的开发任务。
我的扩展 Java 项目与 Alfresco 提出的 Eclipse 项目具有相同的结构。 Y 提供的 Ant 任务,用于在 Tomcat 中编译、压缩 JavaScript 文件、打包和部署生成的 JAR 文件。
我正在开发一些新的 JavaScript 客户端小部件,这意味着每次我进行更改时,我都必须停止 Tomcat,启动 Ant 构建脚本并重新启动,因为我必须经常这样做,您可以猜到这有多痛苦正在变得。我只是想知道是否有任何方法可以加快 Share 上的开发任务。 Alfresco 开发团队是如何做到的?他们建立什么样的环境?
我正在考虑创建一个新的 Ant 目标,它将扩展项目的内容热部署到已部署的 Share web 项目中,当然要考虑路径;顺便说一下,该机制必须允许反向操作。那会可行吗?我们的想法是拥有与开发常规 Web 项目时类似的部署机制:当您进行任何更改时,只需按下“发布”按钮,更改就会填充到服务器中。
我想知道一些技巧和想法,如果可能的话,特别是来自 Alfresco 开发团队。
PS:我已经看过https://forums.alfresco.com/en/viewtopic.php?f=47&t=44850和 https://forums.alfresco.com/en/viewtopic.php?f=48&t=18749 .
最佳答案
有两件事可以大大加快速度:
重新加载 Alfresco Share web 脚本的任务示例:
<target name="deploy-share-webscripts" depends="Share: Copy files" description="Refreshes the list of webscripts">
<exec executable="curl">
<arg value="-d"/>
<arg value="reset=on"/>
<arg value="http://admin:admin@${share.web.url}/page/console?reset=webscripts"/>
</exec>
</target>
附加ant任务的复制部分(src-dirs在构建文件的开头被声明为属性):
<echo message="- Copying java classes" />
<copy todir="${warWebappTargetClasses}" overwrite="false" verbose="true">
<fileset dir="${warTargetJavaDir}" />
</copy>
<echo message="- Copying resource files" />
<copy todir="${warWebappTargetClasses}" overwrite="false" verbose="true">
<fileset dir="${warSrcResourcesDir}" >
<include name="**/model/*"/>
<include name="**/templates/**/*"/>
<include name="**/custom-model-context.xml"/>
<include name="**/web-client-config-custom.xml"/>
<include name="**/webclient.properties"/>
<include name="**/aka-model-resourcebundle*"/>
<include name="log4j.properties"/>
</fileset>
</copy>
<echo message="- Copying resource files from amp into war for quick deployment." />
<copy todir="${warWebappTargetClasses}" overwrite="false" verbose="true">
<fileset dir="${projectAmpResourcesSrcDir}" />
<fileset dir="${projectAmpClassesDir}" />
<fileset dir="${listmanagerAmpResourcesSrcDir}" />
</copy>
<echo message="- Copying config files from amp into war for quick deployment." />
<copy todir="${warWebappTargetClasses}\alfresco\module\Project-amp\" overwrite="false" verbose="true">
<fileset dir="${projectAmpConfigSrcDir}" />
</copy>
</target>
我使用 maven alfresco 生命周期 http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven对于我的设置,这也加快了速度。我相信很多可以添加到这个主题。
关于share - 如何加速 Alfresco Share 的开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14280186/