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> <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>