<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc maxdepth="2"?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>Buildinfo Plugin</title>
<date>2019-11-03</date>
</info>
<note>
<simpara>Version 5 of this plugin will only work with Gradle 5, JDK 8 and does not support Ivy or Subversion.</simpara>
</note>
<section xml:id="asciidocsummary">
<title>Summary</title>
<simpara>This plugin adds information about the build, OS, CI process and SCM to the publish meta file (pom.xml) and
to the jar file. This helps to verify build artifacts.</simpara>
</section>
<section xml:id="asciidocusage">
<title>Usage</title>
<simpara>To use the Gradle Intershop Buildinfo plugin, include the following in your build script:</simpara>
<formalpara>
<title>build.gradle</title>
<para>
<programlisting language="groovy" linenumbering="unnumbered">plugins {
    id 'com.intershop.gradle.buildinfo' version '5.0.0'
}</programlisting>
</para>
</formalpara>
</section>
<section xml:id="asciidocproject-extension-buildinfo">
<title>Project Extension 'buildinfo'</title>
<simpara>This plugin adds an extension <emphasis role="strong"><literal>buildinfo</literal></emphasis> to the project.  This extension contains all plugin configurations.</simpara>
<section xml:id="asciidocproperties">
<title>Properties</title>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="4">
<colspec colname="col_1" colwidth="35*"/>
<colspec colname="col_2" colwidth="35*"/>
<colspec colname="col_3" colwidth="35*"/>
<colspec colname="col_4" colwidth="279*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Property</simpara></entry>
<entry align="left" valign="top"><simpara>Type</simpara></entry>
<entry align="left" valign="top"><simpara>Default value</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">noAdditionalJarInfo</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>boolean</literal></simpara></entry>
<entry align="left" valign="top"><simpara>false</simpara></entry>
<entry align="left" valign="top"><simpara>If this value is true the build information is not stored in the jar file. <?asciidoc-br?>
                                                  <emphasis>This can be overwritten by the system or environment variable <literal>NOJARINFO</literal> or project property <literal>noJarInfo</literal>.</emphasis></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">noDescriptorInfo</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>boolean</literal></simpara></entry>
<entry align="left" valign="top"><simpara>false</simpara></entry>
<entry align="left" valign="top"><simpara>If this value is true the build information is not stored in a descriptor file (ivy/pom). <?asciidoc-br?>
                                                  <emphasis>This can be overwritten by the system or environment variable <literal>noDescriptorInfo</literal> or project property <literal>noDescriptorInfo</literal>.</emphasis></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">ModuleVendor</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"><simpara>''</simpara></entry>
<entry align="left" valign="top"><simpara>The name of the vendor.<?asciidoc-br?>
                                                  This information is always added to the JAR if it is configured.</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section xml:id="asciidocexample-build-information">
<title>Example Build Information</title>
<section xml:id="asciidocmaven-pom-xml">
<title>Maven pom.xml</title>
<formalpara>
<title>project.pom</title>
<para>
<programlisting language="xml" linenumbering="unnumbered">&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.project.group&lt;/groupId&gt;
    &lt;artifactId&gt;project&lt;/artifactId&gt;
    &lt;version&gt;3.0.0&lt;/version&gt;
    &lt;dependencies&gt;
    &lt;/dependencies&gt;
    &lt;properties&gt;
        &lt;!-- properties added by buildinfo gradle plugin - start --/&gt;
        &lt;created-by&gt;1.7.0_80-b15 (Oracle Corporation)&lt;/created-by&gt;
        &lt;build-java-version&gt;1.7.0_80&lt;/build-java-version&gt;
        &lt;java-source-compatibility&gt;1.7.0&lt;/java-source-compatibility&gt;
        &lt;java-target-compatibility&gt;1.7.0&lt;/java-target-compatibility&gt;
        &lt;implementation-version&gt;3.0.0&lt;/implementation-version&gt;
        &lt;build-status&gt;integration&lt;/build-status&gt;
        &lt;built-by&gt;isbldas&lt;/built-by&gt;
        &lt;built-os&gt;Linux&lt;/built-os&gt;
        &lt;build-date&gt;2015-09-21_22:58:51&lt;/build-date&gt;
        &lt;gradle-version&gt;2.6&lt;/gradle-version&gt;
        &lt;module-origin&gt;https://scm.server/projectroot&lt;/module-origin&gt;
        &lt;scm-change-info&gt;e14938d&lt;/scm-change-info&gt;
        &lt;scm-change-time&gt;19700117174747&lt;/scm-change-time&gt;
        &lt;scm-branch-name&gt;e14938df3f85f97065e7b456aef0f14ef669878a&lt;/scm-branch-name&gt;
        &lt;scm-type&gt;git&lt;/scm-type&gt;
        &lt;ci-build-host&gt;buildhost&lt;/ci-build-host&gt;
        &lt;ci-build-url&gt;https://scm.server/projectroot&lt;/ci-build-url&gt;
        &lt;ci-build-number&gt;8&lt;/ci-build-number&gt;
        &lt;ci-build-job&gt;BUILDJOB&lt;/ci-build-job&gt;
        &lt;ci-build-time&gt;2015-09-21T22:56:27.480+02:00&lt;/ci-build-time&gt;
        &lt;!-- properties added by buildinfo gradle plugin - end --/&gt;
    &lt;/properties&gt;
&lt;/project&gt;</programlisting>
</para>
</formalpara>
</section>
<section xml:id="asciidocjar-file">
<title>Jar File</title>
<formalpara>
<title>META-INF\MANIFEST.MF</title>
<para>
<programlisting language="properties" linenumbering="unnumbered">Manifest-Version: 1.0
Created-By: 1.7.0_80-b15 (Oracle Corporation)
Build-Java-Version: 1.7.0_80
X-Compile-Source-JDK: 1.7
X-Compile-Target-JDK: 1.7
Implementation-Version: 10.0.0
Build-Status: integration
Built-By: gitlab-runner
Built-OS: Linux
Build-Date: 2016-03-26_17:06:24
Gradle-Version: 2.11
Gradle-RootProject: project
Module-Origin: https://buildserver.com/buildjob
SCM-change-info: c05817d
SCM-change-time: 20160326165513
SCM-branch-name: c05817d4cf68230258e1260183bfa26ee18c1cff
SCM-type: git
CI-build-host: buildhost.de
CI-build-url: https://buildhost.de/project/buildjob
CI-build-number: 1462
CI-build-job: buildjob
CI-build-time: 2016-02-22T15:09:15.508+01:00</programlisting>
</para>
</formalpara>
</section>
<section xml:id="asciidoctest">
<title>Test</title>
<simpara>The integration tests using a test repositories. Therefore it is necessary to specify project properties for the test execution.</simpara>
<table frame="all" rowsep="1" colsep="1">
<title>Table Git test configuration</title>
<tgroup cols="3">
<colspec colname="col_1" colwidth="33.3333*"/>
<colspec colname="col_2" colwidth="33.3333*"/>
<colspec colname="col_3" colwidth="33.3334*"/>
<thead>
<row>
<entry align="left" valign="top">Test Property</entry>
<entry align="left" valign="top">Description</entry>
<entry align="left" valign="top">Value</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">giturl</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara>URL of the test project</simpara></entry>
<entry align="left" valign="top"><simpara>Must be specified with environment variable <emphasis role="strong"><literal>GITURL</literal></emphasis></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">gituser</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara>User name of Git test user</simpara></entry>
<entry align="left" valign="top"><simpara>Must be specified with environment variable <emphasis role="strong"><literal>GITUSER</literal></emphasis></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">gitpasswd</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara>Password for Git test user</simpara></entry>
<entry align="left" valign="top"><simpara>Must be specified with environment variable <emphasis role="strong"><literal>GITPASSWD</literal></emphasis></simpara></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id="asciidoclicense">
<title>License</title>
<simpara>Copyright 2014-2016 Intershop Communications.</simpara>
<simpara>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at</simpara>
<simpara><link xl:href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</link></simpara>
<simpara>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</simpara>
</section>
</article>