Liberty로 웹 서비스 앱 개발 노트 : (1) 환경 구축
8387 단어 이클립스LibertyrestJavaEEWebService
소개
웹 서비스(REST) 앱을 개발하고 Liberty상에서 움직일 때까지의 흐름에 대해 시도한 것을 비망록으로 기재해 갑니다.
최종적으로는 Eclipse, Liberty, JAX-RS, GitHub, Maven, JUnit, ... 근처를 사용해 REST 앱의 개발, 테스트, 배포의 흐름을 만들 수 있도록 하는 것이 목표.
우선은 Eclipse의 환경 정비 근처에서.
관련 기사
Liberty로 웹 서비스 앱 개발 노트 : (1) 환경 구축
Liberty로 웹 서비스 앱 개발 노트 : (2) Maven 프로젝트로 JAX-RS 앱 개발
Liberty로 웹 서비스 앱 개발 노트 : (3) JPA를 통한 DB 액세스
Liberty로 웹 서비스 앱 개발 노트 : (4) 로깅
Liberty로 웹 서비스 앱 개발 노트 : (5) JUnit으로 단위 테스트
Liberty에 의한 웹 서비스 앱 개발 노트 : (6) Eclipse-GitHub 연계
전제:
Windows 7
Eclipse 4.7 (Oxygen)
자바 8
WebSphere Liberty 17.0.0.x
Eclipse 도입
아래에서 설치 프로그램 다운로드 (여기에서는 Win 64bit 버전)
htps //w w. 에cぃp해. 오 rg / 드 w ぉ 아 ds / 드 w ぉ 아 d. php? 흠 = / 오 mph / 엣 p / 오 xy 겐 / R / 에 c ぃ p 세인 st - 우 64. 네
다운로드한 eclipse-inst-win64.exe 실행
Eclipse IDE for Java EE Developers 선택

설치할 디렉토리를 지정하여 설치

라이선스의 Accept라든지, 화면의 지시에 따라 인스톨을 진행해 나가면 OK.
Liberty 환경 정비
아래 기사의 절차를 참조하십시오 ...
참고 : Bluemix Liberty for Java 개발 환경 정비 (1/3)
Eclipse에 WebSpher Liberty Developer Tool 소개
Eclipse를 시작하고 Help - Eclipse Marketplace를 선택합니다.
IBM WebSphere Application Server Liberty Developer Tools for Oxygen 설치

Feature 선택

Liberty 도입
Servers 뷰에서 Clieck this link to create a new server...를 클릭합니다.

IBM - WebSphere Application Server Liberty 선택

Install from an archive or a repository를 선택

설치 대상을 지정하고 IBM WebSphere Liberty Repository에서 WAS Liberty with Java EE 7 Full Platform 선택

특히 아무것도 지정하지 않고 다음

라이센스 확인
서버 이름 지정

Finish!
서버가 생성됩니다.

Liberty 로그를 UTF-8로 변경
Liberty 로그의 문자 코드는 Windows에서 기본 SJIS가 사용됩니다. 이번은 UTF-8로 통일하기 때문에, 이를 위한 설정 변경을 합니다.
WAS Liberty 배포 디렉토리 아래에 "usr\servers\server_name"이라는 디렉토리가 있으므로 jvm.options라는 파일을 작성합니다.
jvm.options-Dfile.encoding=UTF-8
기타 Eclipse 설정
Eclipse Workspace의 문자 코드를 UTF-8로 설정
Window - Preferences - [General]-[Workspace]를 선택하고 "Text file Encoding"을 UTF-8로 한다.

JDK 설정
Window - Preferences - [Java] - [Installed JREs]를 선택하여 1.8이 설정되어 있는지 확인합니다.


Window - Preferences - [Java] - [Compiler]를 선택하여 Compiler compliance level에 1.8이 설정되어 있는지 확인합니다.

코드 스타일의 포맷터 지정
복수명으로의 개발을 상정해, Code Style의 포매터를 특정의 것으로 설정한다.
여기에서는 「Google Style Guides」를 사용하기로 한다.
아래에서 zip을 다운로드하여 배포.
Google Style Guides
Window - Preferences - [Java]-[Code Style]-[Formatter]를 선택
Import -> 'eclipse-java-google-style.xml'을 import

Window - Preferences - [Java] - [Editor] - [Save Action]을 선택
"Perform the selected actions on save"확인 => "Format source code"확인

덤
Liberty 서버를 작성한 직후의 상태라면, server.xml에 빨강×이 붙어 있어 조금 기분 나쁘다.
이런 느낌...

Merkers 보기의 메시지를 마우스 오른쪽 버튼으로 클릭 - Quick Fix

Add the required server configuration 을 선택하여 Finish

set 버튼

Keystore password 및 Encoding 지정

이제 server.xml에는 다음과 같은 설정이 추가되어 빨간색×이 사라진다.<keyStore id="defaultKeyStore" password="{xor}Pj4+"/>
Reference
이 문제에 관하여(Liberty로 웹 서비스 앱 개발 노트 : (1) 환경 구축), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/tomotagwork/items/3a63ac7955d053a4feb4
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
아래에서 설치 프로그램 다운로드 (여기에서는 Win 64bit 버전)
htps //w w. 에cぃp해. 오 rg / 드 w ぉ 아 ds / 드 w ぉ 아 d. php? 흠 = / 오 mph / 엣 p / 오 xy 겐 / R / 에 c ぃ p 세인 st - 우 64. 네
다운로드한 eclipse-inst-win64.exe 실행
Eclipse IDE for Java EE Developers 선택

설치할 디렉토리를 지정하여 설치

라이선스의 Accept라든지, 화면의 지시에 따라 인스톨을 진행해 나가면 OK.
Liberty 환경 정비
아래 기사의 절차를 참조하십시오 ...
참고 : Bluemix Liberty for Java 개발 환경 정비 (1/3)
Eclipse에 WebSpher Liberty Developer Tool 소개
Eclipse를 시작하고 Help - Eclipse Marketplace를 선택합니다.
IBM WebSphere Application Server Liberty Developer Tools for Oxygen 설치

Feature 선택

Liberty 도입
Servers 뷰에서 Clieck this link to create a new server...를 클릭합니다.

IBM - WebSphere Application Server Liberty 선택

Install from an archive or a repository를 선택

설치 대상을 지정하고 IBM WebSphere Liberty Repository에서 WAS Liberty with Java EE 7 Full Platform 선택

특히 아무것도 지정하지 않고 다음

라이센스 확인
서버 이름 지정

Finish!
서버가 생성됩니다.

Liberty 로그를 UTF-8로 변경
Liberty 로그의 문자 코드는 Windows에서 기본 SJIS가 사용됩니다. 이번은 UTF-8로 통일하기 때문에, 이를 위한 설정 변경을 합니다.
WAS Liberty 배포 디렉토리 아래에 "usr\servers\server_name"이라는 디렉토리가 있으므로 jvm.options라는 파일을 작성합니다.
jvm.options-Dfile.encoding=UTF-8
기타 Eclipse 설정
Eclipse Workspace의 문자 코드를 UTF-8로 설정
Window - Preferences - [General]-[Workspace]를 선택하고 "Text file Encoding"을 UTF-8로 한다.

JDK 설정
Window - Preferences - [Java] - [Installed JREs]를 선택하여 1.8이 설정되어 있는지 확인합니다.


Window - Preferences - [Java] - [Compiler]를 선택하여 Compiler compliance level에 1.8이 설정되어 있는지 확인합니다.

코드 스타일의 포맷터 지정
복수명으로의 개발을 상정해, Code Style의 포매터를 특정의 것으로 설정한다.
여기에서는 「Google Style Guides」를 사용하기로 한다.
아래에서 zip을 다운로드하여 배포.
Google Style Guides
Window - Preferences - [Java]-[Code Style]-[Formatter]를 선택
Import -> 'eclipse-java-google-style.xml'을 import

Window - Preferences - [Java] - [Editor] - [Save Action]을 선택
"Perform the selected actions on save"확인 => "Format source code"확인

덤
Liberty 서버를 작성한 직후의 상태라면, server.xml에 빨강×이 붙어 있어 조금 기분 나쁘다.
이런 느낌...

Merkers 보기의 메시지를 마우스 오른쪽 버튼으로 클릭 - Quick Fix

Add the required server configuration 을 선택하여 Finish

set 버튼

Keystore password 및 Encoding 지정

이제 server.xml에는 다음과 같은 설정이 추가되어 빨간색×이 사라진다.<keyStore id="defaultKeyStore" password="{xor}Pj4+"/>
Reference
이 문제에 관하여(Liberty로 웹 서비스 앱 개발 노트 : (1) 환경 구축), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/tomotagwork/items/3a63ac7955d053a4feb4
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
-Dfile.encoding=UTF-8
Eclipse Workspace의 문자 코드를 UTF-8로 설정
Window - Preferences - [General]-[Workspace]를 선택하고 "Text file Encoding"을 UTF-8로 한다.

JDK 설정
Window - Preferences - [Java] - [Installed JREs]를 선택하여 1.8이 설정되어 있는지 확인합니다.


Window - Preferences - [Java] - [Compiler]를 선택하여 Compiler compliance level에 1.8이 설정되어 있는지 확인합니다.

코드 스타일의 포맷터 지정
복수명으로의 개발을 상정해, Code Style의 포매터를 특정의 것으로 설정한다.
여기에서는 「Google Style Guides」를 사용하기로 한다.
아래에서 zip을 다운로드하여 배포.
Google Style Guides
Window - Preferences - [Java]-[Code Style]-[Formatter]를 선택
Import -> 'eclipse-java-google-style.xml'을 import

Window - Preferences - [Java] - [Editor] - [Save Action]을 선택
"Perform the selected actions on save"확인 => "Format source code"확인

덤
Liberty 서버를 작성한 직후의 상태라면, server.xml에 빨강×이 붙어 있어 조금 기분 나쁘다.
이런 느낌...

Merkers 보기의 메시지를 마우스 오른쪽 버튼으로 클릭 - Quick Fix

Add the required server configuration 을 선택하여 Finish

set 버튼

Keystore password 및 Encoding 지정

이제 server.xml에는 다음과 같은 설정이 추가되어 빨간색×이 사라진다.<keyStore id="defaultKeyStore" password="{xor}Pj4+"/>
Reference
이 문제에 관하여(Liberty로 웹 서비스 앱 개발 노트 : (1) 환경 구축), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/tomotagwork/items/3a63ac7955d053a4feb4
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Reference
이 문제에 관하여(Liberty로 웹 서비스 앱 개발 노트 : (1) 환경 구축), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tomotagwork/items/3a63ac7955d053a4feb4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)