<dependencies>
<!-- spring container(core) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring Web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- jstl -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Oracle JDBC -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>
<!-- spring jdbc(DataSource) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.0</version>
</dependency>
<!-- jackson (json)-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.7</version>
</dependency>
<!-- common fileupload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!-- http components - http client & http core (rest template) -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20201115</version>
</dependency>
<!--mysql-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!--springboot-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.7.5</version>
</dependency>
</dependencies>
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'maven-publish'
}
repositories {
mavenLocal()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
mavenCentral()
}
dependencies {
implementation 'com.oracle.database.jdbc:ojdbc6:11.2.0.4'
implementation 'org.springframework:spring-jdbc:5.3.23'
implementation 'org.mybatis:mybatis:3.5.11'
implementation 'org.mybatis:mybatis-spring:2.0.7'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.7'
implementation 'commons-fileupload:commons-fileupload:1.4'
implementation 'commons-io:commons-io:2.4'
implementation 'org.apache.httpcomponents:httpclient:4.5.2'
implementation 'org.apache.httpcomponents:httpcore:4.4.15'
implementation 'org.json:json:20201115'
implementation 'mysql:mysql-connector-java:8.0.30'
implementation 'commons-dbcp:commons-dbcp:1.4'
implementation 'org.springframework.boot:spring-boot-starter-web:2.7.5'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
}
group = 'boggle'
version = '0.0.1-SNAPSHOT'
description = 'boggle'
java.sourceCompatibility = JavaVersion.VERSION_11
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
기존 라이브러리
변경 라이브러리
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
: jar는 Java Archive의 약자로 자바 환경 위에서 바로 동작할 수 있는 애플리케이션이다
war는 Web Application Archive의 약자로 JSP 혹은 Servlet처럼 WAS 컨테이너 위에서 동작할 수 있는 패키징 방식이다
springboot가 패키징하는 JAR 내부에 Tomcat이 내장되어있기 때문에 JAR로 패키징 되어도 WAR 파일이 구동되는것이다.
이러한 환경 때문에 springboot의 디폴트는 jar 빌드(패키징)이다
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper:10.1.2'
: intellij에서 component로 등록된 것을 @Autowired하여 사용하려면 해당 에러가 발생한다
컴파일 및 서버 실행에 문제는 없지만 해당 오류를 수정할 수 있다
컴포넌트를 사용하려는 클래스 위에 컴포넌트를 스캔할 패키지명을 적어준다
@Autowired(required = false)