0Pricing
Groovy & Gradle: JVM Automation and Build Engineering · Aula

Instalação do Gradle e CLI

Instale o Gradle, compreenda sua interface de linha de comando e execute comandos básicos de compilação.

Instalação do Gradle e CLI é uma aula grátis de Groovy & Gradle: JVM Automation and Build Engineering no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Groovy & Gradle: JVM Automation and Build Engineering, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Groovy & Gradle: JVM Automation and Build Engineering inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

Meet the Gradle CLI

The Gradle Command Line Interface (CLI) is your main tool for interacting with Gradle. It's how you tell Gradle what to do, like building your project or running tests.

Understanding the CLI is crucial for automating your build processes and managing your projects effectively.

Java is Required!

Before installing Gradle, you need to have the Java Development Kit (JDK) installed on your system. Gradle runs on the Java Virtual Machine (JVM), just like Java applications.

  • Ensure you have JDK 8 or higher.
  • You can check your Java version with: java -version

How to Install Gradle

There are several ways to install Gradle. For beginners, using a version manager like SDKMAN! is highly recommended. It simplifies managing multiple SDK versions.

  • SDKMAN!: Easy and flexible.
  • Manual Download: More setup required.
  • Package Managers: Homebrew (macOS), Chocolatey (Windows).

Install Gradle via SDKMAN!

SDKMAN! (Software Development Kit Manager) makes installing Gradle super easy. If you don't have SDKMAN!, install it first by following instructions on sdkman.io.

Once SDKMAN! is ready, open your terminal and run:

sdk install gradle

Check Your Gradle Version

After installation, it's a good practice to verify that Gradle is correctly installed and accessible from your terminal. This command shows the Gradle version and other environment details.

Run this in your terminal:

gradle -v

Discovering Gradle Tasks

The most common command to start with is gradle tasks. This command lists all available tasks for the current project. If you're not in a Gradle project, it shows generic tasks.

Let's try it:

gradle tasks

What `gradle tasks` Shows

When you run gradle tasks, you'll see categories like "Build tasks", "Verification tasks", etc., each with a list of tasks and their descriptions.

  • Tasks: Are the actual actions Gradle performs (e.g., build, clean, test).
  • Description: Explains what each task does.

This output helps you understand what operations your project supports.

Need Help? Use `gradle help`

Gradle has a built-in help system. If you want to know more about a specific task, you can use the help task with the --task option.

For example, to learn about the build task:

gradle help --task build

Intro to Gradle Wrapper (gradlew)

Many Gradle projects include a Gradle Wrapper (gradlew or gradlew.bat). This script ensures everyone uses the same Gradle version for a project, even if they don't have Gradle installed globally.

You'll often run commands like ./gradlew build instead of gradle build.

Test Your CLI Knowledge

Let's check your understanding of basic Gradle commands!

Recap: Gradle CLI Essentials

Great job! In this lesson, you learned how to:

  • Understand the role of the Gradle CLI.
  • Install Gradle using SDKMAN!.
  • Verify your installation with gradle -v.
  • List available tasks using gradle tasks.
  • Get help for specific tasks with gradle help --task <taskName>.
  • Briefly grasp the concept of the Gradle Wrapper.

Next, we'll dive into setting up a basic Gradle project!

Perguntas Frequentes

A aula “Instalação do Gradle e CLI” é grátis?

Sim — o texto completo de “Instalação do Gradle e CLI” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Groovy & Gradle: JVM Automation and Build Engineering, atualize para CoddyKit PRO. O curso de Groovy & Gradle: JVM Automation and Build Engineering inclui 4 aulas no total.

O que vou aprender em “Instalação do Gradle e CLI”?

Instale o Gradle, compreenda sua interface de linha de comando e execute comandos básicos de compilação. Você pratica Groovy & Gradle: JVM Automation and Build Engineering com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Groovy & Gradle: JVM Automation and Build Engineering?

Nenhuma experiência prévia é necessária. Groovy & Gradle: JVM Automation and Build Engineering no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.

Quanto tempo leva a aula “Instalação do Gradle e CLI”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Groovy & Gradle: JVM Automation and Build Engineering?

Sim. Cada aula de Groovy & Gradle: JVM Automation and Build Engineering inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Instalação do Gradle e CLI
  2. Estrutura de projetos Gradle
  3. Tarefas e ciclo de vida da compilação
  4. Compilações Multiprojeto e o Ficheiro de Definições
← Voltar para Groovy & Gradle: JVM Automation and Build Engineering