토리맘의 한글라이즈 프로젝트 logo 토리맘의 한글라이즈 프로젝트

스프링 클라우드 컨트랙트 공식 레퍼런스를 한글로 번역한 문서입니다.

전체 목차는 여기에 있습니다.

목차

9.1.1. Cloning the repository on Windows

Windows에서 Spring Cloud Contract 프로젝트를 클론받는 경우, git 레포지토리의 일부 파일이 Windows 최대 파일 경로 제한인 255자를 초과해서 제대로 체크아웃받지 못할 수도 있다 (아마 일부만).

이 문제를 해결하려면 core.longPaths 속성을 true로 설정해서 Spring Cloud Contract 레포지토리를 클론하면 된다.

core.longPaths 속성을 true로 설정할 때에는 세 가지 옵션이 있다:

git config --system core.longPaths true
git clone https://github.com/spring-cloud/spring-cloud-contract.git
git config --global core.longPaths true
git clone https://github.com/spring-cloud/spring-cloud-contract.git
git clone -c core.longPaths=true https://github.com/spring-cloud/spring-cloud-contract.git

소스 코드를 제대로 가져오려면 IDE에 필요한 모든 Groovy 플러그인이 설치되어 있어야 한다. 예를 들어 Intellij IDEA에서는 Eclipse Groovy Compiler 플러그인과 GMavenPlus Intellij 플러그인이 모두 설치돼 있어야 프로젝트를 제대로 임포트할 수 있다.

Spring Cloud Contract는 Docker 이미지를 빌드한다. Docker가 설치되어 있어야 한다.

오프라인 모드에서 빌드를 실행하려면 Maven 3.5.2 버전 이상이 설치되어 있어야 한다.

9.1.2. Project structure

Spring Cloud Contract 폴더의 구조는 다음과 같다:

├── config
├── docker
├── samples
├── scripts
├── specs
├── spring-cloud-contract-dependencies
├── spring-cloud-contract-shade
├── spring-cloud-contract-starters
├── spring-cloud-contract-stub-runner
├── spring-cloud-contract-stub-runner-boot
├── spring-cloud-contract-tools
├── spring-cloud-contract-verifier
├── spring-cloud-contract-wiremock
└── tests

프로젝트 구조에서 가장 최상위에 있는 폴더에 대해 설명해보면:

9.1.3. Commands

Maven 플러그인과 핵심 기능을 함께 빌드하려면 다음 명령어를 실행해라:

./mvnw clean install -P integration

위 함수를 호출하면 코어 모듈과, Maven 플러그인, Gradle 플러그인이 빌드된다.

그래들 플러그인만 빌드하려면 아래 명령어를 실행하면 된다:

cd spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin
./gradlew clean build

9.1.4. Helpful scripts

프로젝트를 빌드할 때 유용할만한 스크립트를 몇 가지 제공한다.

프로젝트를 병렬로 빌드하려면 (기본적으로 코어를 4개 사용하지만 변경할 수 있다), 다음 명령어를 실행해라:

./scripts/parallelBuild.sh

코어 8개를 사용하려면 다음 명령어를 실행해라:

CORES=8 ./scripts/parallelBuild.sh

통합 테스트 없이 프로젝트를 빌드하려면 (기본적으로 하나의 코어를 사용한다), 다음 명령어를 실행해라:

./scripts/noIntegration.sh

코어 8개를 사용하려면 다음 명령어를 실행해라:

CORES=8 ./scripts/noIntegration.sh

문서를 생성하려면 (루트 프로젝트 문서와 maven 플러그인 문서), 다음 명령어를 실행해라:

./scripts/generateDocs.sh

Next :
9.2. Configuration Properties
Spring Cloud Contract 설정 프로퍼티 정리

전체 목차는 여기에 있습니다.

<< >>

TOP