Skip to content

Commit

Permalink
Update mvn-pub.xml
Browse files Browse the repository at this point in the history
making the mvn-pub.xml 99% similar to 7.0.104-TT one
  • Loading branch information
cesarhernandezgt authored Sep 29, 2023
1 parent 8168785 commit 87cbf00
Showing 1 changed file with 74 additions and 5 deletions.
79 changes: 74 additions & 5 deletions res/maven/mvn-pub.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -26,14 +26,59 @@
<property name="aether.checksums.algorithms" value="MD5,SHA-1,SHA-256,SHA-512"/>

<target name="init-maven">
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant">
<antcall target="downloadfile">
<param name="sourcefile" value="${maven-resolver-ant-tasks.loc}"/>
<param name="destfile" value="${maven-resolver-ant-tasks.jar}"/>
<param name="destdir" value="${maven-resolver-ant-tasks.home}"/>
</antcall>

<taskdef resource="org/apache/maven/resolver/ant/antlib.xml"
uri="antlib:org.apache.maven.resolver.ant">
<classpath>
<pathelement location="${basedir}/maven-ant-tasks-2.1.3.jar" />
<pathelement location="${maven-resolver-ant-tasks.jar}" />
</classpath>
</typedef>
</taskdef>
</target>

<target name="maven-install" depends="init-maven">
<!--cleanup-->
<delete file="${pom}.tmp"/>

<!--replace the version in the pom-->
<copy file="${pom}" tofile="${pom}.tmp">
<filterset>
<filter token="MAVEN.DEPLOY.VERSION" value="${maven.deploy.version}"/>
</filterset>
</copy>

<resolver:install file="${file}">
<pom file="${pom}.tmp"/>
</resolver:install>

<delete file="${pom}.tmp"/>
</target>

<macrodef name="doMavenInstall">
<attribute name="artifactId"/>
<attribute name="jarFileName" default="@{artifactId}.jar" />
<attribute name="groupId" default="org.apache.tomcat" />
<attribute name="file" default="${tomcat.lib.path}/@{jarFileName}" />
<attribute name="pom" default="@{artifactId}.pom" />
<attribute name="srcJarFileName" default="@{artifactId}-src.jar" />
<attribute name="src" default="${tomcat.src.path}/@{srcJarFileName}" />
<sequential>
<antcall target="maven-install">
<param name="file" value="@{file}"/>
<param name="groupId" value="@{groupId}"/>
<param name="artifactId" value="@{artifactId}"/>
<param name="pom" value="${tomcat.pom.path}/@{pom}"/>
<param name="src" value="@{src}"/>
<param name="src.skip" value="@{src.skip}"/>
<param name="maven.deploy.version" value="${maven.asf.release.deploy.version}-dev"/>
</antcall>
</sequential>
</macrodef>

<target name="maven-deploy" depends="init-maven">
<!--cleanup-->
<delete file="${pom}.tmp"/>
Expand Down Expand Up @@ -399,4 +444,28 @@
<arg value="${file.in}"/>
</exec>
</target>

<!-- =============== Utility Targets to support downloads ================ -->

<target name="setproxy" if="${proxy.use}">
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
<echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
</target>

<target name="testexist">
<echo message="Testing for ${destfile}"/>
<available file="${destfile}" property="exist"/>
</target>

<target name="downloadfile" unless="exist" depends="testexist,setproxy">
<!-- Download the file -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-" suffix=".tmp"/>
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${temp.file}"/>
<mkdir dir="${destdir}"/>
<move file="${temp.file}" tofile="${destfile}"/>
</target>

</project>

0 comments on commit 87cbf00

Please sign in to comment.