2016-10-06 74 views
0

我是新来的蚂蚁,我不得不换我的web项目在war文件,我用蚂蚁 我的项目的结构类似:蚂蚁变化目录结构

的myproject
--images
--css
--js

,并在战争文件的最终结构是这样的:

的myproject
--css
--images
--js
--meta-INF
--Web-INF

我想改变最终的结构(以把一切都在“公共”文件夹中的项目目录),但只有在战争的文件,我想是这样的:

的myproject
个--public
----- CSS
-----图像
----- JS
--meta-INF
--Web-INF

我有尝试使用复制任务和移动任务,但没有成功... 我该怎么做才能做到这一点?

+0

可以显示当前的脚本? – Rao

+0

嗨饶迄今为止这是这样的https://jsfiddle.net/n6n6b8h4/ – T1000

回答

1

我认为,在一个zipfileset使用prefix属性可以帮助你(看到zipfileset):

<target name="Wrappin the in war file" description="Compiling...."> 
    <mkdir dir="${build-directory}" /> 
    <delete file="${build-directory}/${war-file-name}" /> 
    <war warfile="${build-directory}/${war-file-name}" webxml="${web-xml-file}"> 
     <zipfileset dir="${web-directory}" prefix="public"> 
      <exclude name=".git/**" /> 
      <exclude name=".svn/**" /> 
      <exclude name=".idea/**" /> 
      <exclude name="node_modules/**" /> 
      <exclude name="bower_components/**" /> 
     </zipfileset> 
     <manifest> 
      <attribute name="Built-By" value="${builder}" /> 
      <attribute name="Built-On" value="${build-info.current-date}" /> 
      <attribute name="Built-At" value="${build-info.current-time}" /> 
     </manifest> 
    </war> 
</target>