jenkins构建配置-打包EAR问题

问题描述 投票:0回答:1

我已经为jenkins设置了构建配置,并且在打包EAR时,它在构建时忽略了一个xml文件。我想确保通过构建配置来更新文件。

''''''EAR Packager文件

<property name="librariesFolderPath" value="${basedir}/../libs" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
        <pathelement location="${librariesFolderPath}/ant-contrib.jar" />
    </classpath>
</taskdef>

<property environment="env" />

<condition property="partialWsPath" value="**/${TO_BUILD}/**" else="**">
    <and>
        <isset property="TO_BUILD" />
        <not>
            <equals arg1="${TO_BUILD}" arg2="" trim="true" />
        </not>
    </and>
</condition>

<condition property="lurch.properties.file" value="${project.properties.file}" else="lurchproject.properties">
    <and>
        <isset property="project.properties.file" />
        <not>
            <equals arg1="${project.properties.file}" arg2="" trim="true" />
        </not>
    </and>
</condition>

<pathconvert property="project.properties.path">
    <fileset dir="${env.WORKSPACE}" includes="${partialWsPath}/${lurch.properties.file}" />
</pathconvert>

<property file="${project.properties.path}" />
<propertyregex property="studio.buildnumber" input="${studio.version}" regexp="(.*)[a-zA-Z]$" select="\1" defaultvalue="${studio.version}" />
<property file="${basedir}/../config/builderstructure.properties" />
<property file="${basedir}/barpackager.properties" />
<property file="${runtime.properties.file}" />

<property name="lurch.customized.folder.path" value="${basedir}/../../customized" />

<!-- Retriving deploy-project name -->
<propertyregex property="deploy.project.name" input="${deploy.project}" regexp="([^\\/]*)[\\/]?$" select="\1" />

<!-- Retriving the list of libraries that mustn't be in the ear -->
<propertyregex property="targetj2ee" input="${target.j2ee}" regexp=" " replace="_" global="true" />
<propertycopy property="libs2cutoff" from="libs2cutoff.${targetj2ee}" />


<!-- ================================= 
      target: default             
     ================================= -->
<target name="earsPackagingCompleted"
        depends="init,evaluateConditions,createDeployJar,generateManifest,createEJB,createWAR,createEar,customizeEar"
        description="Calls all the targets needd to generate the ear" />

<!-- ================================= 
      target: init            
     ================================= -->
<target name="init" description="Compute the build order">
    <delete dir="${output.ears}" includeemptydirs="true" />

    <mkdir dir="${output.ears.tmp.lib}" />
    <mkdir dir="${output.ears.tmp.war}/META-INF" />
    <mkdir dir="${output.ears.tmp.ejb}/META-INF" />
</target>

<!-- ================================= 
      target: evaluateConditions              
     ================================= -->
<target name="evaluateConditions" depends="" description="Evaluates conditions rekated to ear creation">
    <condition property="appl.srv.project.folder"
               value="${runtime.projects.to.build}/${deploy.project.name}/${deploy.appl.srv.folder}/${target.j2ee}">
        <!-- else="${eclipse.plugins}/${appl.srv.studio.folder}/${target.j2ee}" -->
        <and>
            <isset property="deploy.appl.srv.folder" />
            <not>
                <equals arg1="${deploy.appl.srv.folder}" arg2="" trim="true" />
            </not>
            <isset property="target.j2ee" />
            <not>
                <equals arg1="${target.j2ee}" arg2="" trim="true" />
            </not>
            <available file="${runtime.projects.to.build}/${deploy.project.name}/${deploy.appl.srv.folder}" type="dir" />
            <available file="${runtime.projects.to.build}/${deploy.project.name}/${deploy.appl.srv.folder}/${target.j2ee}" type="dir" />
            <resourcecount when="greater" count="0">
                <fileset dir="${runtime.projects.to.build}/${deploy.project.name}/${deploy.appl.srv.folder}/${target.j2ee}" />
            </resourcecount>
        </and>
    </condition>

    <echo message="appl.srv.project.folder: ${appl.srv.project.folder}" level="verbose" />
</target>

<!-- ================================= 
      target: createDeployJar             
     ================================= -->
<target name="createDeployJar">
    <!-- Add the DeployInfo.xml file and replace the token with the actual J2EE target server -->
    <copy file="${eclipse.plugins}/${appl.srv.studio.folder}/.misc/config/DeployInfo.xml"
          todir="${runtime.projects.to.build}/${deploy.project.name}/bin/config"
          overwrite="true" />
    <replace file="${runtime.projects.to.build}/${deploy.project.name}/bin/config/DeployInfo.xml" token="%TargetJ2ee%" value="${target.j2ee}" />

    <echo message="[DD] earpackager createDeployJar $${output.jars}/$${deploy.project.name}.jar: '${output.jars}/${deploy.project.name}.jar'."/>
    <echo message="[DD] earpackager createDeployJar $${runtime.projects.to.build}/$${deploy.project.name}/bin: '${runtime.projects.to.build}/${deploy.project.name}/bin'."/>
    <jar destfile="${output.jars}/${deploy.project.name}.jar" keepcompression="true">
        <manifest>
            <attribute name="Created-By" value="Finantix Studio ${studio.version}" />
            <attribute name="Build-Jdk" value="${java.version} ${java.vendor}" />
            <attribute name="Built-By" value="L.U.R.Ch - Fx automated build system - ${builder.full.version}" />
            <attribute name="Implementation-Title" value="${deploy.project.name}" />
            <attribute name="Implementation-Version" value="${project.full.version}" />
            <attribute name="Implementation-Vendor" value="${implementation.vendor}" />
        </manifest>
        <fileset dir="${runtime.projects.to.build}/${deploy.project.name}/bin" />
    </jar>
</target>


<!-- ================================= 
      target: generateManifest            
     ================================= -->
<target name="generateManifest" depends="cleanupJarsForEar" description="Generates the manifest files for the war and ejb files">
    <propertyregex property="classpath.runtime.patches" input="${deploy.libraries}" regexp="," replace=" lib/" global="true" />
    <propertyregex property="classpath.runtime.patches" input="${classpath.runtime.patches}" regexp="(.*)" select="lib/\1" override="true" />

    <echo message="classpath.runtime.patches: ${classpath.runtime.patches}" level="verbose" />

    <pathconvert property="classpath.other.runtime.patches" pathsep=" ">
        <path>
            <fileset dir="${project.libraries.folder.path}/${4Ear.patches}"
                     includes="${selectable.required.libraries}"
                     excludes="${selectable.deploy.libraries}" />
            <fileset dir="${project.libraries.folder.path}/${4EarAndCompiling.patches}"
                     includes="${selectable.required.libraries}"
                     excludes="${selectable.deploy.libraries}" />
            <fileset dir="${project.libraries.folder.path}/${4Ear.lib3p}"
                     includes="${selectable.required.libraries}"
                     excludes="${selectable.deploy.libraries}" />
            <fileset dir="${project.libraries.folder.path}/${4EarAndCompiling.lib3p}"
                     includes="${selectable.required.libraries}"
                     excludes="${selectable.deploy.libraries}" />
            <fileset dir="${project.libraries.folder.path}/${4Ear.libJavaPrj}"
                     includes="${selectable.required.libraries}"
                     excludes="${selectable.deploy.libraries}" />
            <fileset dir="${project.libraries.folder.path}/${4EarAndCompiling.libJavaPrj}"
                     includes="${selectable.required.libraries}"
                     excludes="${selectable.deploy.libraries}" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <globmapper from="*" to="lib/*" />
        </chainedmapper>
    </pathconvert>

    <echo message="classpath.other.runtime.patches: ${classpath.other.runtime.patches}" level="verbose" />

    <pathconvert property="classpath.generated.bars" pathsep=" ">
        <path>
            <fileset dir="${output.bars}" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <globmapper from="*" to="lib/*" />
        </chainedmapper>
    </pathconvert>

    <echo message="classpath.generated.bars: ${classpath.generated.bars}" level="verbose" />

    <pathconvert property="classpath.generated.jars" pathsep=" ">
        <path>
            <fileset dir="${output.jars}" includes="**/*.*" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <globmapper from="*" to="lib/*" />
        </chainedmapper>
    </pathconvert>

    <echo message="classpath.generated.jars: ${classpath.generated.jars}" level="verbose" />

    <pathconvert property="classpath.not.generated.libs.and.bars" pathsep=" ">
        <path>
            <fileset dir="${input.ftp.bars}" includes="${required.bars}" excludes="${libs.and.bars.to.exclude}" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <globmapper from="*" to="lib/*" />
        </chainedmapper>
    </pathconvert>

    <echo message="classpath.not.generated.libs.and.bars: ${classpath.not.generated.libs.and.bars}" level="verbose" />

    <pathconvert property="classpath.studio.bars" pathsep=" ">
        <path>
            <fileset dir="${eclipse.plugins}" includes="${bars.from.fs.plugins}" excludes="${libs2cutoff}" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <globmapper from="*" to="lib/*" />
        </chainedmapper>
    </pathconvert>

    <echo message="classpath.studio.bars: ${classpath.studio.bars}" level="verbose" />

    <pathconvert property="classpath.fs.plugins.4.ear" pathsep=" ">
        <path>
            <fileset dir="${eclipse.plugins}" includes="${fs.plugins.4.ear}" excludes="${libs2cutoff},${selectable.required.libraries}" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <globmapper from="*" to="lib/*" />
        </chainedmapper>
    </pathconvert>

    <echo message="classpath.fs.plugins.4.ear: ${classpath.fs.plugins.4.ear}" level="verbose" />

    <!--property name="EARClasspath" value="${classpath.runtime.patches} ${classpath.generated.jars} ${classpath.generated.bars} ${classpath.not.generated.libs.and.bars} ${classpath.other.runtime.patches} ${classpath.studio.bars} ${classpath.studio.plugins} ${classpath.3rd.parties.libs}" /-->
    <property name="EARClasspath"
              value="${classpath.runtime.patches} ${classpath.generated.jars} ${classpath.generated.bars} ${classpath.not.generated.libs.and.bars} ${classpath.other.runtime.patches} ${classpath.studio.bars} ${classpath.fs.plugins.4.ear}" />

    <propertyregex property="EARClasspath" input="${EARClasspath}" regexp="\s+" replace=" " global="true" override="true" />

    <echo message="EARClasspath: ${EARClasspath}" level="verbose" />

    <manifest file="${output.ears.tmp.war}/META-INF/MANIFEST.MF">
        <attribute name="Created-By" value="Finantix Studio ${studio.version}" />
        <attribute name="Build-Jdk" value="${java.version} ${java.vendor}" />
        <attribute name="Built-By" value="L.U.R.Ch - Fx automated build system - ${builder.full.version}" />
        <attribute name="Implementation-Version" value="${project.full.version}" />
        <attribute name="Implementation-Vendor" value="${implementation.vendor}" />
        <attribute name="Class-Path" value="${EARClasspath}" />
    </manifest>

    <copy file="${output.ears.tmp.war}/META-INF/MANIFEST.MF" tofile="${output.ears.tmp.ejb}/META-INF/MANIFEST.MF" />
</target>


<!-- ================================= 
      target: cleanupJarsForEar           
     ================================= -->
<target name="cleanupJarsForEar" depends="cleanupBarsForEar" description="Remove java files from the archives to store in the ear.">
    <fileset dir="${output.ears.tmp.lib}" id="jar.files.to.update.id">
        <include name="*.jar" />
        <exclude name="*_bar.jar" />
    </fileset>

    <echo level="info" message="********* Removing source code from jar files *******" />

    <property name="jar.files.to.update" refid="jar.files.to.update.id" />

    <for list="${jar.files.to.update}" delimiter=";" param="jar.file">
        <sequential>
            <echo message="=========================================" />
            <echo message=" Updating ${jar.counter} out of ${number.of.jars.to.update} jar files ..." />
            <exec executable="7za">
                <arg value="d" />
                <arg value="-tzip" />
                <arg value="${output.ears.tmp.lib}/@{jar.file}" />
                <arg value="*.java" />
                <arg value="-r" />
            </exec>

            <math result="jar.counter" operation="+" operand1="${jar.counter}" operand2="1" datatype="int" />
        </sequential>
    </for>
</target>


<!-- ================================= 
      target: cleanupBarsForEar           
     ================================= -->
<target name="cleanupBarsForEar" depends="moveLibraries" description="Remove useless files from the archives to store in the ear.">
    <resourcecount property="number.of.jars.to.update">
        <fileset dir="${output.ears.tmp.lib}">
            <include name="*.jar" />
        </fileset>
    </resourcecount>

    <echo level="info" message="********* Removing source code, java and dat files from ${number.of.jars.to.update} bar files *******" />

    <var name="jar.counter" value="1" />

    <fileset dir="${output.ears.tmp.lib}" id="bar.files.to.update.id">
        <include name="*_bar.jar" />
    </fileset>
    <property name="bar.files.to.update" refid="bar.files.to.update.id" />

    <for list="${bar.files.to.update}" delimiter=";" param="bar.file">
        <sequential>
            <echo message="=========================================" />
            <echo message=" Updating ${jar.counter} out of ${number.of.jars.to.update} bar files ..." />

            <exec executable="7za">
                <arg value="d" />
                <arg value="-tzip" />
                <arg value="${output.ears.tmp.lib}/@{bar.file}" />
                <arg value="META-INF/*.dat" />
                <arg value="META-INF/.bar" />
                <arg value="src" />
                <arg value="*.java" />
                <arg value="-r" />
            </exec>

            <math result="jar.counter" operation="+" operand1="${jar.counter}" operand2="1" datatype="int" />
        </sequential>
    </for>
</target>


<!-- ================================= 
      target: moveLibraries           
     ================================= -->
<target name="moveLibraries" description="Moves files into the lib folder in the temporary ear folder">
    <pathconvert property="libs.and.bars.to.exclude" pathsep=",">
        <path>
            <fileset dir="${output.bars}" />
            <fileset dir="${output.jars}" />
        </path>
        <chainedmapper>
            <mapper type="flatten" />
            <regexpmapper from="(.*)" to="**/\1" />
        </chainedmapper>
    </pathconvert>

    <propertyregex property="selectable.deploy.libraries" input="${deploy.libraries}" regexp="," replace=",**/" global="true" />
    <propertyregex property="selectable.deploy.libraries" input="${selectable.deploy.libraries}" regexp="(.*)" select="**/\1" override="true" />

    <propertyregex property="selectable.required.libraries" input="${required.libraries}" regexp="," replace=",**/" global="true" />
    <propertyregex property="selectable.required.libraries"
                   input="${selectable.required.libraries}"
                   regexp="(.*)"
                   select="**/\1"
                   override="true" />

    <copy todir="${output.ears.tmp.lib}" flatten="true" failonerror="true">
        <fileset dir="${project.libraries.folder.path}/${4Ear.patches}"
                 includes="${selectable.deploy.libraries},${selectable.required.libraries}" />
        <fileset dir="${project.libraries.folder.path}/${4EarAndCompiling.patches}"
                 includes="${selectable.deploy.libraries},${selectable.required.libraries}" />
        <fileset dir="${project.libraries.folder.path}/${4Ear.lib3p}"
                 includes="${selectable.deploy.libraries},${selectable.required.libraries}" />
        <fileset dir="${project.libraries.folder.path}/${4EarAndCompiling.lib3p}"
                 includes="${selectable.deploy.libraries},${selectable.required.libraries}" />
        <fileset dir="${project.libraries.folder.path}/${4Ear.libJavaPrj}"
                 includes="${selectable.deploy.libraries},${selectable.required.libraries}" />
        <fileset dir="${project.libraries.folder.path}/${4EarAndCompiling.libJavaPrj}"
                 includes="${selectable.deploy.libraries},${selectable.required.libraries}" />
        <fileset dir="${output.bars}" />
        <fileset dir="${output.jars}" />
        <fileset dir="${input.ftp.bars}" includes="${required.bars}" excludes="${libs.and.bars.to.exclude}" />
        <fileset dir="${eclipse.plugins}" includes="${bars.from.fs.plugins}" excludes="${libs2cutoff}" />
        <fileset dir="${eclipse.plugins}" includes="${fs.plugins.4.ear}" excludes="${libs2cutoff},${selectable.required.libraries}" />
    </copy>
</target>


<!-- ================================= 
      target: createEJB           
     ================================= -->
<target name="createEJB">
    <copy todir="${output.ears.tmp.ejb}" overwrite="false">
        <fileset dir="${eclipse.plugins}/${appl.srv.studio.folder}/${target.j2ee}/EJB" />
    </copy>

    <antcall target="updateWithCustomFiles">
        <param name="destination.folder" value="${output.ears.tmp.ejb}" />
        <param name="source.folder" value="${appl.srv.project.folder}/EJB" />
        <param name="overwrite" value="true" />
    </antcall>

    <jar destfile="${output.ears.tmp}/${ejb.name}.jar" basedir="${output.ears.tmp.ejb}" manifest="${output.ears.tmp.ejb}/META-INF/MANIFEST.MF" />

    <delete dir="${output.ears.tmp.ejb}" includeEmptyDirs="true" />
</target>


<!-- ================================= 
      target: createWAR           
     ================================= -->
<target name="createWAR">
    <copy todir="${output.ears.tmp.war}" overwrite="true">
        <fileset dir="${web.project.folder.path}">
            <exclude name="work/" />
            <exclude name="**/.classpath" />
            <exclude name="**/.project" />
        </fileset>
    </copy>

    <copy todir="${output.ears.tmp.war}" overwrite="false">
        <fileset dir="${eclipse.plugins}/${appl.srv.studio.folder}/${target.j2ee}/WAR" />
    </copy>

    <antcall target="updateWithCustomFiles">
        <param name="destination.folder" value="${output.ears.tmp.war}" />
        <param name="source.folder" value="${appl.srv.project.folder}/WAR" />
        <param name="overwrite" value="true" />
    </antcall>

    <for list="${web.project.version.files}" delimiter="," param="web.project.version.file">
        <sequential>
            <replace file="${output.ears.tmp.war}/@{web.project.version.file}"
                     token="${web.project.version.token}"
                     value="${project.full.version}" />
        </sequential>
    </for>

    <antcall target="evaluateWebXmlConditions">
        <param name="web.xml.path" value="${output.ears.tmp.war}/WEB-INF/web.xml" />
    </antcall>

    <war destfile="${output.ears.tmp}/${war.name}.war"
         basedir="${output.ears.tmp.war}"
         manifest="${output.ears.tmp.war}/META-INF/MANIFEST.MF"
         webxml="${output.ears.tmp.war}/WEB-INF/web.xml" />

    <delete dir="${output.ears.tmp.war}" includeEmptyDirs="true" />
</target>


<!-- ================================= 
      target: evaluateWebXmlConditions            
     ================================= -->
<target name="evaluateWebXmlConditions">
    <loadfile property="web.content" srcFile="${web.xml.path}">
        <filterchain>
            <tokenfilter>
                <filetokenizer />
                <replaceregex pattern="&lt;!--.*?--&gt;" flags="gs" replace="" />
            </tokenfilter>
        </filterchain>
    </loadfile>

    <condition property="workManagerIsToAdd">
        <not>
            <contains string="${web.content}" substring="&lt;res-ref-name&gt;wm/WorkManager&lt;/res-ref-name&gt;" />
        </not>
    </condition>

    <condition property="ejbTimerIsToAdd">
        <not>
            <contains string="${web.content}" substring="&lt;ejb-ref-name&gt;ejb/EJBTimerServiceExecutorHome&lt;/ejb-ref-name&gt;" />
        </not>
    </condition>

    <antcall target="addWorkManager" />

    <antcall target="addEjbTimer" />
</target>


<!-- ================================= 
      target: addWorkManager              
     ================================= -->
<target name="addWorkManager" if="workManagerIsToAdd">
    <property name="tab" value="&#x0009;" />

    <replaceregexp file="${web.xml.path}"
                   match="&lt;/servlet-mapping&gt;([^\w&gt;]*)&lt;resource-ref&gt;"
                   replace="&lt;/servlet-mapping&gt;${line.separator}${tab}&lt;resource-ref&gt;${line.separator}${tab}${tab}&lt;!--WorkManager--&gt;${line.separator}${tab}${tab}&lt;description&gt;Required for concurrency support&lt;/description&gt;${line.separator}${tab}${tab}&lt;res-ref-name&gt;wm/WorkManager&lt;/res-ref-name&gt;${line.separator}${tab}${tab}&lt;res-type&gt;commonj\.work\.WorkManager&lt;/res-type&gt;${line.separator}${tab}${tab}&lt;res-auth&gt;Container&lt;/res-auth&gt;${line.separator}${tab}${tab}&lt;res-sharing-scope&gt;Shareable&lt;/res-sharing-scope&gt;${line.separator}${tab}&lt;/resource-ref&gt;${line.separator}${tab}&lt;resource-ref&gt;"
                   flags="s" />
</target>


<!-- ================================= 
      target: addEjbTimer             
     ================================= -->
<target name="addEjbTimer" if="ejbTimerIsToAdd">
    <property name="tab" value="&#x0009;" />

    <replaceregexp file="${web.xml.path}"
                   match="&lt;/web-app&gt;"
                   replace="${tab}&lt;!--EJB Timer reference --&gt;${line.separator}${tab}&lt;ejb-ref&gt;${line.separator}${tab}${tab}&lt;ejb-ref-name&gt;ejb/EJBTimerServiceExecutorHome&lt;/ejb-ref-name&gt;${line.separator}${tab}${tab}&lt;ejb-ref-type&gt;Session&lt;/ejb-ref-type&gt;${line.separator}${tab}${tab}&lt;home&gt;com.finantix.foundation.integration.ejbtimer.EJBTimerServiceExecutorHome&lt;/home&gt;${line.separator}${tab}${tab}&lt;remote&gt;com.finantix.foundation.integration.ejbtimer.EJBTimerServiceExecutor&lt;/remote&gt;${line.separator}${tab}${tab}&lt;ejb-link&gt;EJBTimerServiceExecutor&lt;/ejb-link&gt;${line.separator}${tab}&lt;/ejb-ref&gt;${line.separator}&lt;/web-app&gt;"
                   flags="s" />
</target>


<!-- ================================= 
      target: createEar           
     ================================= -->
<target name="createEar">
    <copy todir="${output.ears.tmp}" overwrite="true">
        <fileset dir="${eclipse.plugins}/${appl.srv.studio.folder}/${target.j2ee}/EAR" />
    </copy>

    <antcall target="updateWithCustomFiles">
        <param name="destination.folder" value="${output.ears.tmp}" />
        <param name="source.folder" value="${appl.srv.project.folder}/EAR" />
        <param name="overwrite" value="true" />
    </antcall>

    <replace file="${output.ears.tmp}/META-INF/application.xml" token="%ContextRoot%" value="${context.root}" />
    <replace file="${output.ears.tmp}/META-INF/application.xml" token="%WARName%" value="${war.name}" />
    <replace file="${output.ears.tmp}/META-INF/application.xml" token="%EJBName%" value="${ejb.name}" />

    <jar destfile="${output.ears}/${ear.name}.ear" basedir="${output.ears.tmp}">
        <manifest>
            <attribute name="Created-By" value="Finantix Studio ${studio.version}" />
            <attribute name="Build-Jdk" value="${java.version} ${java.vendor}" />
            <attribute name="Built-By" value="L.U.R.Ch - Fx automated build system - ${builder.full.version}" />
            <attribute name="Implementation-Version" value="${project.full.version}" />
            <attribute name="Implementation-Vendor" value="${implementation.vendor}" />
        </manifest>
    </jar>

    <delete dir="${output.ears.tmp}" includeEmptyDirs="true" />
</target>


<!-- ================================= 
      target: updateWithCustomFiles           
     ================================= -->
<target name="updateWithCustomFiles" depends="evaluateCopyConditions" if="copy.is.executable">
    <copy todir="${destination.folder}" overwrite="${overwrite}">
        <fileset dir="${source.folder}" />
    </copy>
</target>


<!-- ================================= 
      target: evaluateCopyConditions              
     ================================= -->
<target name="evaluateCopyConditions">
    <condition property="copy.is.executable">
        <and>
            <isset property="appl.srv.project.folder" />
            <available file="${source.folder}" type="dir" />
        </and>
    </condition>
</target>


<!-- ================================= 
      target: customizeEar
     ================================= -->
<target name="customizeEar" if="custom.script.path" depends="checkForCustomScript">
    <propertyregex property="workspaces.folder.path" input="${project.properties.path}" regexp="(.*?)/[^\\/]*$" select="\1" />

    <ant antfile="${custom.script.path}" inheritAll="false">
        <property name="ant-contrib.jar.path" value="${librariesFolderPath}/ant-contrib.jar" />
        <property name="lurch.libraries.folder.path" value="${librariesFolderPath}" />
        <property name="output.ears.folder.path" value="${output.ears}" />
        <property name="ear.name" value="${ear.name}" />
        <property name="deploy.project.name" value="${deploy.project.name}" />
        <property name="studio.version" value="${studio.version}" />
        <property name="java.version" value="${java.version}" />
        <property name="java.vendor" value="${java.vendor}" />
        <property name="builder.full.version" value="${builder.full.version}" />
        <property name="project.full.version" value="${project.full.version}" />
        <property name="workspaces.folder.path" value="${workspaces.folder.path}" />
        <property name="output.bars.folder.path" value="${output.bars}" />
        <property name="output.jars.folder.path" value="${output.jars}" />
        <property name="output.ddls.folder.path" value="${output.ddls}" />
        <property name="output.processes.folder.path" value="${output.processes}" />
        <property name="output.translations.folder.path" value="${output.translations}" />

        <property name="manifest.properties.file" value="${manifest.properties.file}" />

        <propertyset>
            <propertyref prefix="${custom.ear.properties.prefix}" />
        </propertyset>
    </ant>
</target>


<!-- ================================= 
      target: checkForCustomScript
     ================================= -->
<target name="checkForCustomScript">
    <condition property="custom.script.path" value="${lurch.customized.folder.path}/${project.phase.id}/${custom.ear.script}">
        <and>
            <isset property="project.phase.id" />
            <not>
                <equals arg1="project.phase.id" arg2="" trim="true" />
            </not>
            <available file="${lurch.customized.folder.path}/${project.phase.id}/${custom.ear.script}" type="file" />
        </and>
    </condition>
</target>

'''''''''''''''''']

文件名是FxCONF.xml,需要打包在Deploy JAR中。

[请告知我如何更改上面的代码,以确保在定格时包括此文件。

jenkins jenkins-plugins
1个回答
0
投票

Java不是我的专长,但我相信要移动和使用文件(FxConf.xml),需要添加此复制操作。

如果我了解您的需求,我想这里就是方法:

How do I create an EAR file with an ant build including certain files?

这里可以是另一个参考。https://gist.github.com/mudzot/865511

您使用蚂蚁吗?

我希望能提供更多帮助而不是阻碍。 :)

© www.soinside.com 2019 - 2024. All rights reserved.