Detailed procedures for building Liferay theme using Ant

Source: Internet
Author: User
Tags copy echo message root directory

Record today Liferay project from ant Switch to maven lesson.

For tomorrow's demo, we've switched all the Liferay projects that were built with Ant to Maven, and the results are not always visible when deploying a theme application built by MAVEN to a Liferay server. I worked for half an hour, only to find out why, because _diffs the following content is not copied to the theme root directory.

Because we used to pack and deploy with Ant, the Liferay ant script automatically merges all the resources under _diffs into the outer layer (that is, the theme application root directory). We thought that _diffs directly copied the past, and did not look at the final artifact structure. So there was a mistake.

Back home, I looked carefully at the Liferay Ant building the theme project, the original _diffs directory was created at Target when the create was executed, and its role was simply to make it easier for developers to change resources different from the framework. So switch to Maven, the directory itself has no effect, only the content in this directory is useful.

Create:

<target name= "Create" > <if> <or> <not> <isset property= "Theme.name"/> </not> <not> &L T;isset property= "Theme.display.name"/> </not> </or> &LT;THEN&G 
                T 
               <echo message= "This task must is called by Create.bat."/> </then> <else> 
                        ... <copy todir= "${theme.dir}" > <fileset Dir= "${project.dir}/tools/theme_tmpl"/> </copy> &l 
                    T;mkdir dir= "${theme.dir}/docroot/_diffs"/> <replace dir= "${theme.dir}" > <replacefilter token= "@theme. name@" value= "${theme.name}"/> <replacefilter token= "@the Me.display.name@ "value=" ${theme.display.name} "/> </replace> </else> &L T;/if> </target>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.