본문 바로가기
[AWS]/GITLAB

51장. 빌드 단계: 로컬에서 Java 애플리케이션 빌드

by SAMSUNG CLOUD-OKY 2022. 2. 21.
반응형

 

 

## CMD 빌드 방법

 

## GUI 빌드 방법 (build - libs - cars-api.jar 파일 생성)

 

## GUI Clean 방법 (cars-api.jar 파일 삭제)

 

 

 

 

## 하기 내용시 재부팅 할것!!

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

 

 

 

 

## Gradle이란 무엇입니까?

 

개요

Gradle은 거의 모든 유형의 소프트웨어를 빌드할 수 있을 만큼 충분히 유연하도록 설계된 오픈 소스 빌드 자동화 도구입니다. 다음은 가장 중요한 기능 중 일부에 대한 개괄적인 개요입니다.

고성능

Gradle은 입력 또는 출력이 변경되어 실행해야 하는 작업만 실행하여 불필요한 작업을 방지합니다. 또한 빌드 캐시를 사용하여 이전 실행 또는 다른 시스템(공유 빌드 캐시 포함)의 작업 출력을 재사용할 수 있습니다.

Gradle이 구현하고 개발 팀이 Gradle의 성능을 개선하기 위해 지속적으로 노력하는 다른 많은 최적화가 있습니다.

JVM 기초

Gradle은 JVM에서 실행되며 이를 사용하려면 JDK(Java Development Kit)가 설치되어 있어야 합니다. 이것은 사용자 정의 작업 유형 및 플러그인과 같은 빌드 로직에서 표준 Java API를 사용할 수 있으므로 Java 플랫폼에 익숙한 사용자를 위한 보너스입니다. 또한 다양한 플랫폼에서 Gradle을 쉽게 실행할 수 있습니다.

Gradle은 JVM 프로젝트만 빌드하는 것으로 제한되지 않으며 기본 프로젝트 빌드 지원과 함께 패키지로 제공됩니다.

규약

Gradle은 Maven의 책에서 일부를 가져와서 규칙을 구현하여 Java 프로젝트와 같은 일반적인 유형의 프로젝트를 쉽게 구축할 수 있도록 합니다. 적절한 플러그인을 적용하면 많은 프로젝트를 위한 슬림한 빌드 스크립트로 쉽게 끝낼 수 있습니다. 그러나 이러한 규칙이 제한되지 않습니다. Gradle을 사용하면 규칙을 재정의하고, 고유한 작업을 추가하고, 규칙 기반 빌드에 다른 많은 사용자 지정을 수행할 수 있습니다.

확장성

Gradle을 쉽게 확장하여 고유한 작업 유형을 제공하거나 모델을 빌드할 수도 있습니다. 이에 대한 예는 Android 빌드 지원을 참조하세요. 여기에는 플레이버 및 빌드 유형과 같은 많은 새로운 빌드 개념이 추가됩니다.

IDE 지원

Android Studio, IntelliJ IDEA, Eclipse 및 NetBeans와 같은 여러 주요 IDE를 사용하여 Gradle 빌드를 가져와 상호 작용할 수 있습니다. Gradle은 또한 프로젝트를 Visual Studio로 로드하는 데 필요한 솔루션 파일 생성을 지원합니다.

통찰력

빌드 스캔 은 빌드 문제를 식별하는 데 사용할 수 있는 빌드 실행에 대한 광범위한 정보를 제공합니다. 빌드 성능과 관련된 문제를 식별하는 데 특히 유용합니다. 빌드 스캔을 다른 사람과 공유할 수도 있습니다. 이는 빌드 문제를 해결하기 위해 조언을 구해야 할 때 특히 유용합니다.

 

https://docs.gradle.org/current/userguide/what_is_gradle.html

 

What is Gradle?

Gradle is an open-source build automation tool that is designed to be flexible enough to build almost any type of software. The following is a high-level overview of some of its most important features: High performance Gradle avoids unnecessary work by on

docs.gradle.org

 

 

==================================================

 

Let's start with a build stage, even if you're not the Java developer or have absolutely no relation

to Java, you probably already know that most programs have to go through a build stage.

The build process will take the source code and transform it into something that can be executed on

a computer.

We call this process compilation.

In this case, the bail process will translate the source code into Java, bytecode that can be executed

on the Java virtual machine, which is typically what a server will have installed.

The output of this built process is a jar file, which is an archive that contains this byte code is

Java bytecode.

To run the build process locally, I will use a tool called Gradle, which is just a built to.

You'll find that it's quite easy to use.

The moment we have started this application, we have already built it, but I'm just going to show

you again how this works.

So from this Cradle panel, which you can open it from here and go to build Paape.

And click on Build.

This will take a few seconds to complete, but finally it will report back build successful if there

are any errors with the code and the build does not work because it cannot be compiled to the Java bytecode,

then a narrow will show up.

And in this case, the build was successful.

Every time the build is completed, a new built folder will be created.

In order to view the output, you'll have to go to build lips and this car that shaped that car is our

artifact.

This is what we can run using the job on future machine.

I have showed you this in a graphical interface, but just as well I can use the terminal in order to

build this.

The comment for doing that is using the Grayden wrapper that's can be accessed using this comment.

And I'm using a reference to the local Ford using that that's just in case the grader is somehow installed

globally and just wanted to reference the local file that I have right here.

And I'm going to use here build.

Greta has already detected that nothing has changed in the code and has simply reused the current bill.

If I want to make sure that I create a new build, I can use the clean command.

And a clean command will remove the built folder.

And then they can build it again and will take through the entire process.

If you look back at the project funds, you will see that a build folder has appeared again and under.

This is the artifact that has been generated.

I'm going to do exactly the same.

But using it lexia because we want to automate everything.

 

 

 

반응형

댓글