Building older version from sourcesBuilding older version from sourceshttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1207540602024-03-29T05:55:45Z2024-03-29T05:55:45ZRE: Building older version from sourcesAmaury Gzhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1212557722023-01-29T21:48:22Z2021-11-20T06:07:04Z<p>Hi, I hope this will help:</p>
<p>About the missing ant dependencies, adding the <a
href="https://www.jacoco.org/jacoco/trunk/index.html">jacocoant.jar</a> and <a
href="https://maven.apache.org/ant-tasks/download.cgi">maven-ant-tasks.jar</a> into
the /lib ant folder worked for me.</p>
<p>Then also I was having troubles trying to deploy an old version,
using only "ant compile" the Bundle-Version in the bnd.bnd
files had been upgraded by the gradle task: baseline. So, searching in
the source code on GitHub I found out that in the <a
href="https://github.com/liferay/liferay-portal/blob/7.3.4-ga5/build-common-java.xml">build-common-java.xml</a> file
there is a condition that controls the execution of such task</p>
<pre>
<code class="language-html"><equals arg1="${baseline.jar.report.level}" arg2="off" /></code></pre>
<p>The baseline.jar.report.level property was defined in the
build.properties with the default value of persist</p>
<p>Then I created the build.myusername.properties file like the
build.properties file says and added the line</p>
<pre>
<code class="language-html">baseline.jar.report.level=off</code></pre>
<p>and using "ant compile deploy" the portal was created into
the ../bundles directory with the expected versions.</p>
<p> </p>
<p>Note: The Bundles versions are upgraded as described <a
href="https://github.com/liferay/liferay-portal/tree/7.3.4-ga5/modules/sdk/gradle-plugins-baseline">here</a>
because the plugin prepares the project for the next release. </p>Amaury Gz2021-11-20T06:07:04ZRE: Building older version from sourcesJan Tošovskýhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1207888792021-05-17T14:09:55Z2021-05-17T14:09:13Z<p>I finally found the corresponding code in build-common.xml<br />
<br />I commented these lines</p>
<p><!--<br /><record-artifact-version artifact.name="portal-impl" file="${gradle.properties.file}" /><br /><record-artifact-version artifact.name="portal-kernel" file="${gradle.properties.file}" /><br /><record-artifact-version artifact.name="portal-test" file="${gradle.properties.file}" /><br /><record-artifact-version artifact.name="util-bridges" file="${gradle.properties.file}" /><br /><record-artifact-version artifact.name="util-java" file="${gradle.properties.file}" /><br /><record-artifact-version artifact.name="util-taglib" file="${gradle.properties.file}" /><br />--></p>
<p>and added these lines instead with hardcoded versions:</p>
<p><propertyfile file="${gradle.properties.file}"><br />
<entry key="com.liferay.portal.impl.version" value="5.13.4" /><br /> <entry key="com.liferay.portal.kernel.version" value="9.0.3" /><br />
<entry key="com.liferay.portal.test.version" value="8.1.1" /><br /> <entry key="com.liferay.util.bridges.version" value="7.0.5" /><br />
<entry key="com.liferay.util.java.version" value="5.0.7" /><br /> <entry key="com.liferay.util.taglib.version" value="5.2.1" /><br /></propertyfile></p>
<p>There was one extra change needed to build the portal-impl.jar
artifact successfully.<br />
<br />In same build-common.xml file I had to comment these lines in
the "install-portal-artifact" macro:</p>
<p><!--<br /><artifact:install file="${artifact.name}.@{packaging}"><br /> <attach-files /><br /> <localRepository path="${build.repository.local.dir}" unless:blank="${build.repository.local.dir}" /><br /> <pom file="pom.xml" /><br /></artifact:install><br />--><br />That
code requires some dependencies not available on my machine. Maybe it
could be fixed easily, but as I found the only artifact I needed
(portal-impl.jar) in the portal-impl directory, I was reluctant to
invest more time to it.</p>Jan Tošovský2021-05-17T14:09:13ZBuilding older version from sourcesJan Tošovskýhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1207540592021-05-17T14:10:58Z2021-05-04T14:26:53Z<p>I'd like to fix one urgent issue in class located in portal-impl.jar
in older 7.3.4-ga5 version. However, I am unable to build it from
sources following the
procedure in https://portal.liferay.dev/participate/fix-a-bug/building-liferay-source
with these changes:</p>
<ul>
<li>used liferay-binaries-cache-2020 repo instead of liferay-binaries-cache-2017</li>
<li>after cloning my fork of the liferay-portal repo I checked out the
7.3.4-ga5 tag</li>
<li>
<p>commented this target as ant cannot find some dependency (and
this goal doesn't seem to be crucial for
me)<br /><target depends="jar,jar-sources" name="install-portal-snapshot"><br /><!--<br />
<install-portal-artifact snapshot="true"><br />
<attach classifier="sources" file="${artifact.name}-sources.jar" /><br /> </install-portal-artifact><br />--><br /></target></p></li></ul>
<p>But once I run ant compile install-portal-snapshots, it fails when
compiling Petra classes because of
missing com.liferay.portal.kernel-10.0.0-SNAPSHOT.jar dependency. In
7.3.4 this jar was shipped in version 9.0.3. That 10.0.0-SNAPSHOT is
specified in .gradle/gradle.properties, but my changes are always
rewritten by a fresh version during the build.</p>
<ol>
<li>Is that build procedure applicable to old releases? If not, what
is the better method?</li>
<li>How can I o