intellij community버전은 밑바닥부터 설정해야한다.
아래 글을 따라했다.
https://www.bsidesoft.com/6160
[java] 인텔리제이 무료 버전으로 스프링5 MVC개발하기(Maven) - Bsidesoft co.
개요 돈 많은 회사의 직원 분들은 그저 회사에 인텔리제이 얼티밋을 사달라고 하면 해결될지 모르겠지만 우리 같은 서민은 그게 쉽지 않습니다. 다행히 무료버전인 community 에디션이 있죠! 사실
www.bsidesoft.com
최신 intellij의 인터페이스가 달라져서 프로젝트 생성부분을 다시 쓴다.
1. 메이븐 프로젝트 생성하기
Project를 클릭한다.
Name : 프로젝트 이름
Language : Java 선택
Build system : Maven 선택
JDK : 로컬에 설치된 JDK 선택(1.8, 11, 17 추천) 나는 JDK 17을 선택했다.
GroupID : 처음에 com.example만 있을텐데 .을 찍고 프로젝트이름인 springMVCtest를 붙여줬다. 프로젝트 이름을 자동으로 붙여주지 않기때문에 직접 작성하면 된다. 사진을 구별을 위해 다르게 했다.
2. pom.xml을 약간 수정했다.
spring-webmvc의 버전을 최신버전인 6.0.11로 수정
jetty-maven-plugin의 버전을 최신버전인 11.0.15로 수정
둘다 프로젝트를 생성한 2023년 9월 19일 기준이고 버전 확인은 다음 사이트를 참고했다.
https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-maven-plugin/11.0.16
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>springMVC</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>6.0.11</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>11.0.15</version>
<configuration>
<httpConnector>
<port>9080</port>
</httpConnector>
<scanIntervalSeconds>0</scanIntervalSeconds>
<webApp>
<contextPath>/</contextPath>
</webApp>
</configuration>
</plugin>
</plugins>
</build>
</project>
3. 나머지는 똑같다.
maven을 reload하고 서버를 실행하면 정상적으로 작동한다.
그런데 web.xml에 뭔가 문제가 있는것 같다.
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
여기서 빨간 밑줄이 쳐지길래 마우스를 올려봤더니
'org.springframework.web.servlet.DispatcherServlet' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.Servlet'
가 떴고
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
여기서도 빨간 밑줄이 쳐져서 봤더니
'org.springframework.web.filter.CharacterEncodingFilter' is not assignable to 'javax.servlet.Filter,jakarta.servlet.Filter'
비슷한 경고가 떴다.
이건 나중에 고쳐봐야겠다.
'Springboot' 카테고리의 다른 글
스프링부트 테스트 시 리액트 앱 빌드 건너뛰기 (0) | 2024.02.03 |
---|---|
React & Springboot 통합 빌드시 Whitelabel Error 해결 (0) | 2024.01.24 |
[spring boot 3.1.4]spring security formLogin에서 로그인 안될때 (0) | 2023.10.10 |
스프링xml로 의존성 주입시 JUnit4와 JUnit5 차이 (0) | 2023.09.19 |
spring에서 xml로 bean객체 등록할때 NoSuchBeanDefinitionException: No bean named 'id명' available (0) | 2023.09.19 |