Spring Web - 설치, 톰캣 서버 설치, 메이븐 프로젝트 생성하기

반응형

 

스프링 설치

  • 아래의 사이트에서 환경에 맞는 스프링 다운로드

https://spring.io/tools

 

Spring Tools 4 is the next generation of Spring tooling

Largely rebuilt from scratch, Spring Tools 4 provides world-class support for developing Spring-based enterprise applications, whether you prefer Eclipse, Visual Studio Code, or Theia IDE.

spring.io


메이븐 프로젝트 생성

  • File - New - Other

 

  • Maven Project - Next

 

  • workpace 지정 (본인이 원하는 경로에 설정)

 

  • archetypes(maven-archetype-webapp) 선택 - Next
  • 메이븐 프로젝트의 뼈대(디렉토리 구조를 만들어주는 템플릿)를 자동으로 생성해주는 기능

 

  • 임의의 Group Id / Atifact Id 입력 - Finish


톰캣 설치

  • 아래의 사이트에 접속해서 원하는 버전 다운로드

https://tomcat.apache.org/download-80.cgi

 

Apache Tomcat® - Apache Tomcat 8 Software Downloads

Welcome to the Apache Tomcat® 8.x software download page. This page provides download links for obtaining the latest versions of Tomcat 8.x software, as well as links to the archives of older releases. Unsure which version you need? Specification versions

tomcat.apache.org


톰캣 서버 생성

  • (Package Explorer) New - Other

 

  • server 검색 - Server 선택 - Next

 

  • 원하는 톰캣 버전과 호스트 이름, 서버 이름 설정

 

  • 톰캣을 저장해둔 폴더로 경로 설정
  • JRE 자바 버전 확인
    • 자바 버전은 개인 환경에 다를 수 있으며 발생되는 호환성 에러 또한 다를 수 있습니다.
  • Next

 

  • 생성한 프로젝트를 선택하여 Add 버튼 클릭 (Configured로 이동)


메이븐 프로젝트에 톰캣 서버 연결

  • 프로젝트 우클릭 - Run As - Run on Server

 

  • 생성한 서버 선택 - Next

 

  • Configured에 생성한 프로젝트가 있는지 확인
  • 없으면 Add키를 눌러 이동
  • Finish


프로젝트 실행, 로컬 서버 실행 확인

  • 프로젝트 우클릭 - Run As - Run on Server

 

  • 실행 화면
    • 기본적으로 'Hello World!' 라는 문구가 담긴 index.jsp 파일이 있음


프로젝트 실행 관련 Error

supperclass javax.servlet ~ 에러 발생시

https://luvris2.tistory.com/367

 

STS Error ) The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

에러 내용 메이븐 프로젝트를 생성하자마자 생성된 에러 해석해보자면 웹 서버를 작동하는 서블릿 클래스가 경로에 없다 다시 풀어보면, 서블랫 클래스를 호환하는 톰캣 서버가 존재하지 않다

luvris2.tistory.com


dynamic web module facet version~ 에러 발생시

https://luvris2.tistory.com/369

 

STS Error) The superclass "javax.servlet.http.HttpServlet", determined from the Dynamic Web Module facet version (x.x), was not

에러 내용 다이나믹 웹 모듈의 버전을 알 수 없음 해석해보면 다이나믹 웹 모듈의 버전이 설정한 경로 내에 존재하지 않음 다시 풀어보면, 설정한 다이나믹 웹 모듈이 설정한 웹 모듈과 버전이

luvris2.tistory.com


several ports (8005, 8080, 8009)~ 에러 발생시

https://luvris2.tistory.com/370

 

STS Error) 'Starting Tomcat Server at localhost has' has encountered a problem

에러 내용 'Starting Tomcat Server at localhost has' has encountered a problem Serveral port (8005, 8080, 8009) required by Tomcat Server at localhost are already in use. 톰캣 로컬 서버에 문제 발생, 해당 포트들은 이미 사용되어 있

luvris2.tistory.com

반응형