써먹는 웹개발

[SAP Learning] Set Up SAP Business Application Studio for CAP Java 본문

SAP/Learning

[SAP Learning] Set Up SAP Business Application Studio for CAP Java

kmhan 2024. 7. 11. 16:18


728x90
반응형

※ 매뉴얼 출처 : https://developers.sap.com/tutorials/cp-cap-java-app-studio.html


1. Open SAP Business Application Studio and create your Dev Space

 1) SAP BTP Cockpit Trial 화면 접속한 후에 SAP Business Application Studio를 클릭합니다.

 2) 프로젝트 명과 종류를 선택하고 Create Dev Space를 클릭합니다.

   - Create a New Dev Space : CAPTutorial

   - What kind of application do you want to create? Full Stack Cloud Application


2. Create application skeleton

 1) 메뉴에서 Terminal → New Terminal 를 클릭합니다.

 2) Terminal에서 cd projects 명령어를 실행합니다.

 3) 다음 명령어를 실행합니다.

1
2
3
4
mvn -B archetype:generate -DarchetypeArtifactId=cds-services-archetype -DarchetypeGroupId=com.sap.cds \
  -DarchetypeVersion=RELEASE -DjdkVersion=17 \
  -DgroupId=com.sap.cap -DartifactId=products-service -Dpackage=com.sap.cap.productsservice
 
cs

 4) 메뉴에서 File -> Open Folder 클릭 후에 다음 경로를 입력 및 선택합니다.

  - /home/user/projects/ 입력후에 products-service 선택


3. Define a service

 1) srv 경로에 admin-service.cds 파일을 생성합니다.

 2) 파일 내용에 다음을 입력합니다.

1
2
3
4
5
6
7
service AdminService {
    entity Products {
        key ID : Integer;
        title  : String(111);
        descr  : String(1111);
    }
}
cs

 


4. Compile model definition

 1) 터미널에서 pwd 명령어를 실행하여 products-service 경로인지 확인합니다.

 2) mvn clean install 명령어 실행합니다.

 

5. Run the application

 1) products-service 경로로 이동합니다.

 2) mvn clean spring-boot:run 명령어를 입력합니다.

 ※ 8080 포트로 새탭에서 실행화면을 열어볼수있습니다.

 

 

728x90
반응형


Comments