// Copyright (C) 2024 Gradle, Inc.
//
// Licensed under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 International License.;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// 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.

[[build_scans]]
= Build Scans

++++
<div class="badge-wrapper">
    <a class="badge" href="https://dpeuniversity.gradle.com/app/courses/b5069222-cfd0-4393-b645-7a2c713853d5/" target="_blank">
        <span class="badge-type button--blue">LEARN</span>
        <span class="badge-text">How to Use Build Scans&nbsp;&nbsp;&nbsp;&gt;</span>
    </a>
</div>
++++

A build scan is a *representation of metadata captured* as you run your build.

image::gradle-basic-1.png[]

== About Build Scans

Gradle <<#sec:captured-information,captures your build metadata>> and sends it to the link:https://scans.gradle.com/[Build Scan Service].
The service then transforms the metadata into information you can analyze and share with others.

image::build-scan-1.png[]

The information that scans collect can be an invaluable resource when troubleshooting, collaborating on, or optimizing the performance of your builds.

For example, with a build scan, it’s no longer necessary to copy and paste error messages or include all the details about your environment each time you want to ask a question on Stack Overflow, Slack, or the Gradle Forum.
Instead, copy the link to your latest build scan.

image::build-scan-2.png[]

== Enable Build Scans

To enable build scans on a gradle command, add `--scan` to the command line option:

[source,text]
----
 ./gradlew build --scan
----

You may be prompted to agree to the terms to use Build Scans.

Visit the link:https://scans.gradle.com/[Build Scans page] to learn more.

[[sec:captured-information]]
== Captured Information

To see what data is captured and sent in a Build Scan, refer to the link:https://docs.gradle.com/develocity/gradle-plugin/current/#captured_information)[Captured Information] section in the Gradle Develocity Plugin documentation.

Ready to build something? Start with the <<gradle_basics.adoc#gradle,Beginner Tutorial>>.

[.text-right]
**Next Step:** <<part1_gradle_init.adoc#part1_gradle_init,Start the Tutorial>> >>
