spring-boot maven config

잘모르겠고 일단 설치.

중간쯤 보면 Visual Studio Code 설정이 나온다

Install from the Visual Studio Marketplace:

More detailed instructions on installing extension from Visual Studio Marketplace can be found here

복붙을 해보았다. 자꾸 주변에서 eclipse 가 구리다고해서 뭐 eclipse 가 막 매력적이진 않지만.. 그래도 익숙한지라.. intelliJ 는 유료라.. ㅠㅠ 개발자가 이런데 돈아끼는게 왠지 죄악같지만.. 마침 핫하다는 VSCode 가 있으니까 이것부터 해보자라는 마음에 설치하라는것까진 일단 설치했는데..

근데 포터블이 있네? 삭제 후 다시 다운로드

unzip 후 폴더안에 data 폴더만 만들어주면 된다고 한다.

VSCode 에는 프로젝트를 생성하는 기능이 없단다.. 어느 블로거가.. 그래서 위의 싸이트에서 이것저것 입력하고 프로젝트생성을 누르니까 알아서 프로젝트 zip 파일을 다운받게해준다. zip 을 풀어서 VSCode 프로젝트 폴더를 만들고 그안에 넣어준뒤 폴더열기를 했음.

아니, 그래서 컴파일해서 서버 어떻게 띄워?

.vscode/settings.json
{
    "java.configuration.updateBuildConfiguration": "automatic",
    "java.home": "D:/noneedinstall/Java/jdk1.8.0_211"
}

위와같이 java home 설정을 해주었다. 그러면 java support plugin 이 재시작을 하라고 하는데 VSCode 재기동이 겁나 빠르네 자꾸 SpringBootApplicationF5 로 기동하면 database url 을 찾길래 pom.xml 을 다지우고 뜨는것만 보기위해서 간략하게만 남겨두고 기동성공!

pom.xml
<?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>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.5.RELEASE</version>
	</parent>

	<groupId>com.harm</groupId>
	<artifactId>first-vscode-spring-boot</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<name>first-vscode-spring-boot</name>
	<description>Demo project for Spring Boot</description>

	<properties>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<version>2.1.5.RELEASE</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>

이제 공부를 VSCode 로 할 수 있겠다 히히 기선이형 기다려요

resources 폴더에 logback-spring.xml 을 넣어두고 해당 폴더를 classpath 에 추가하면 자동으로 spring boot 가 설정파일을 물고간다. 로그백설정까지 끝! 야호!

Last updated

Was this helpful?