일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- JavaScript
- MSSQL
- Core Java
- oracle
- 문서
- 오픈소스
- IntelliJ
- Spring Boot
- JDBC
- Eclipse
- Docker
- git
- STS
- jpa
- Exception
- SpringBoot
- ubuntu
- 설정
- spring
- AJAX
- MySQL
- Python
- error
- Thymeleaf
- Source
- Open Source
- maven
- PostgreSQL
- myBatis
- Tomcat
- Today
- Total
헤르메스 LIFE
[개발환경] Spring + Maven + MyBatis + HSQL Simple Web Sample 본문
[개발환경] Spring + Maven + MyBatis + HSQL Simple Web Sample
헤르메스의날개 2022. 8. 17. 22:59
갑자기 Spring 3.x 환경으로 개발환경을 구축하려니, 고생스럽네요.
덕분에 이것 저것 급조해서 간단하게 만들어봤습니다.
현재는 Eclipse plugin의 지원이 원할치 않습니다.
neon3 버전 이전버전은 Marketplace 가 연결되지 않더군요.
그렇기 때문에, 이러한 환경을 만드는 것 조차 힘들었습니다.
개발환경
pom.xml
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.study.spring</groupId>
<artifactId>sample-spring-webapp</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>sample-spring-webapp Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>3.2.14.RELEASE</org.springframework.version>
<org.slf4j.version>1.5.8</org.slf4j.version>
<log4jdbc-version>0.2.7</log4jdbc-version>
<org.codehaus.jackson.version>1.9.3</org.codehaus.jackson.version>
<org.mybatis.version>3.1.1</org.mybatis.version>
<org.mybatis.spring.version>1.1.1</org.mybatis.spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</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>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<!-- Log Dependencies-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>${log4jdbc-version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.rome</groupId>
<artifactId>rome</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${org.codehaus.jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${org.codehaus.jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.7</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.18</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${org.mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${org.mybatis.spring.version}</version>
</dependency>
</dependencies>
<build>
<finalName>sample-spring-webapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<warSourceDirectory>webapp</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</build>
</project>
/webapp/WEB-INF/web.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<web-app version= "2.4" xmlns ="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Archetype Created Web Application </display-name>
<!-- parent spring bean xml -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/config/spring/context-root.xml</param-value>
</context-param>
<!-- application listener -->
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener </listener-class>
</listener>
<!-- utf-8 filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- spring dispatcher -->
<servlet>
<servlet-name>springDispatcher</servlet-name>
<servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/springmvc/dispatcher-servlet.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springDispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>Index.do</welcome-file>
</welcome-file-list>
</web-app>
dispatcher-servlet.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<beans xmlns= "http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<!-- annotation config & scan -->
<context:annotation-config />
<context:component-scan base-package ="spring.simple.test">
<context:include-filter type= "annotation" expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type= "annotation" expression="org.springframework.stereotype.Service" />
<context:exclude-filter type= "annotation" expression="org.springframework.stereotype.Repository" />
</context:component-scan>
<!-- JSR-303 support will be detected on classpath and enabled automatically -->
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.FormHttpMessageConverter" >
<property name ="charset">
<bean class ="java.nio.charset.Charset" factory-method ="forName">
<constructor-arg value ="UTF-8" />
</bean>
</property>
</bean>
<bean class="org.springframework.http.converter.feed.AtomFeedHttpMessageConverter" >
<property name ="supportedMediaTypes" value ="application/atom+xml" />
</bean>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" >
<property name ="supportedMediaTypes" value ="application/json" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- classpath 로딩시 locale parameter 가 정상적으로 동작하지 않음. <mvc:annotation-driven> 과 같은 파일내에서 사용 -->
<mvc:interceptors>
<bean id ="webContentInterceptor" class="org.springframework.web.servlet.mvc.WebContentInterceptor" >
<property name ="cacheSeconds" value="0" />
<property name ="useExpiresHeader" value ="true" />
<property name ="useCacheControlHeader" value ="true" />
<property name ="useCacheControlNoStore" value ="true" />
</bean>
</mvc:interceptors>
<!-- view name tanslator -->
<bean id="viewNameTranslator" class="org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator" />
<!-- view resolver -->
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver" >
<property name ="mediaTypes">
<map>
<entry key ="json" value="application/json" />
<entry key ="xml" value="application/xml" />
<entry key ="do" value="text/html" />
</map>
</property>
<property name ="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name ="prefix" value="/WEB-INF/views/jsp/" />
<property name ="suffix" value=".jsp" />
<property name ="order" value="2" />
</bean>
</list>
</property>
</bean>
</beans>
/src/main/resource/config/spring/context-root.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<beans:beans xmlns= "http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation ="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<beans:import resource="context/context-common.xml" />
<beans:import resource="context/context-datasource.xml" />
<beans:import resource="context/context-mapper.xml" />
<beans:import resource="context/context-transaction.xml" />
</beans:beans>
/src/main/resource/config/spring/context/context-common.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<beans xmlns= "http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<!-- annotation enabled -->
<context:annotation-config />
<context:component-scan base-package ="spring.simple.test">
<context:exclude-filter type= "annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
</beans>
/src/main/resource/config/spring/context/context-datasource.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<beans xmlns= "http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
<jdbc:embedded-database id ="dataSource" type="HSQL" />
<jdbc:initialize-database data-source ="dataSource" ignore-failures="DROPS" >
<jdbc:script location ="classpath:database/hsqldb/schema.sql" />
<jdbc:script location ="classpath:database/hsqldb/data.sql" />
</jdbc:initialize-database>
</beans>
/src/main/resource/config/spring/context/context-mapper.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<beans xmlns= "http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="sqlSessionFactory" class= "org.mybatis.spring.SqlSessionFactoryBean" >
<property name ="dataSource" ref="dataSource" />
<property name ="configLocation" value="classpath:config/mapper/mybatis-config-base.xml" />
<property name ="mapperLocations">
<list>
<value> classpath*:spring/simple/test/sample/**/dao/*Mapper.xml </value>
</list>
</property>
</bean>
<!-- scan for mappers and let them be autowired -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer" >
<property name ="basePackage" value="spring.simple.test.sample" />
</bean>
</beans>
/src/main/resource/config/spring/context/context-transaction.xml
<?xml version= "1.0" encoding ="UTF-8"?>
<beans xmlns= "http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
<tx:annotation-driven proxy-target-class="true" />
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" p:dataSource-ref ="dataSource" />
</beans>
/src/main/resource/config/mapper/mybatis-config-base.xml
<?xml version= "1.0" encoding ="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name ="cacheEnabled" value="true" />
<setting name ="lazyLoadingEnabled" value ="false" />
<setting name ="multipleResultSetsEnabled" value ="true" />
<setting name ="useColumnLabel" value ="true" />
<setting name ="useGeneratedKeys" value ="false" />
<setting name ="defaultExecutorType" value ="SIMPLE" />
<setting name ="defaultStatementTimeout" value ="25000" />
</settings>
<typeHandlers>
<!-- java.sql.Timestamp 를 java.util.Date 형으로 반환 -->
<typeHandler javaType ="java.sql.Timestamp" handler="org.apache.ibatis.type.DateTypeHandler" />
<typeHandler javaType ="java.sql.Time" handler="org.apache.ibatis.type.DateTypeHandler" />
<typeHandler javaType ="java.sql.Date" handler="org.apache.ibatis.type.DateTypeHandler" />
</typeHandlers>
</configuration>
/src/main/resource/database/hsqldb/schema.sql
create table t_sample (
sample_no int not null,
title varchar(500) not null,
description varchar (1000) not null,
primary key (sample_no)
);
/src/main/resource/database/hsqldb/data.sql
insert into t_sample (sample_no, title, description) values (1, '타이틀 1', '설명 1');
insert into t_sample (sample_no, title, description) values (2, '타이틀 2', '설명 2');
insert into t_sample (sample_no, title, description) values (3, '타이틀 3', '설명 3');
insert into t_sample (sample_no, title, description) values (4, '타이틀 4', '설명 4');
insert into t_sample (sample_no, title, description) values (5, '타이틀 5', '설명 5');
insert into t_sample (sample_no, title, description) values (6, '타이틀 6', '설명 6');
insert into t_sample (sample_no, title, description) values (7, '타이틀 7', '설명 7');
commit;
http://localhost:9090/sample-spring-webapp/sample/hello
http://localhost:9090/sample-spring-webapp/sample/list
참조
개발환경 전체
1. eclipse.ini
-startup plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.defaultAction openFile --launcher.appendVmargs -vm C:/SpringMvnWeb/jdk1.8.0_202/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.8 -Xverify:none -XX:+UseParallelGC -XX:-UseConcMarkSweepGC -XX:PermSize=32M -XX:MaxPermSize=128M -XX:MaxNewSize=32M -XX:NewSize=32M -Xms512m -Xmx1024m |
2. Maven 3.8.6
setting.xml
STS 플러그인 설치
Spring Tools 4는 Eclipse Neon(4.6.3)에서 사용할 수 없으며, 최신 Eclipse 버전만 지원한다고 합니다. Neon에서 사용할 수 있는 버전은 Spring Tool Suite 3(3.9.8)은 Eclipse 2018-09, 2018-12 및 2019-03 정도. Eclipse 4.6과의 호환성을 위해 빌드된 Spring Tool Suite 3의 최신 버전은 3.9.4 하지만 이 버전은 더 이상 지원되지 않으므로, 최신 Eclipse 버전으로 업데이트 해야 한다고 합니다. |
https://github.com/spring-projects/sts4/issues/274
개발환경 다운로드
https://mega.nz/file/MakC0CDK#tCCYVOg13Cq4xccC2SlNviCuAcxJVF--oQGFaS0Q3RA
개발환경 셋팅
c:\SpringMvnWeb 폴더에 압축파일을 풀면 됩니다.
실행 - eclipse.exe 파일을 실행합니다.
참고
context-datasource.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
<!-- 아래와 같이 바꿈.
<jdbc:embedded-database id="dataSource" type="HSQL" />
<jdbc:initialize-database data-source="dataSource" ignore-failures="DROPS">
<jdbc:script location="classpath:database/hsqldb/schema.sql" />
<jdbc:script location="classpath:database/hsqldb/data.sql" />
</jdbc:initialize-database>
-->
<beans profile="dev">
<jdbc:embedded-database id="embdDataSource" type="HSQL">
<jdbc:script location="classpath:database/hsqldb/schema.sql" />
<jdbc:script location="classpath:database/hsqldb/data.sql" />
</jdbc:embedded-database>
<!-- Custom sql formatter -->
<bean id="dataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
<constructor-arg ref="embdDataSource" />
<property name="logFormatter">
<bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
<property name="loggingType" value="MULTI_LINE" />
<property name="sqlPrefix" value="[SQL] " />
</bean>
</property>
</bean>
</beans>
</beans>
'Spring Framework' 카테고리의 다른 글
[개발환경] Spring + Maven + MyBatis + PostgreSQL (0) | 2022.11.20 |
---|---|
[Maven] Dynamic Web Project를 Maven Project 로 Convert 하기 (0) | 2022.11.18 |
Spring Boot 설정파일 암호화 (0) | 2022.05.29 |
[QueryDSL] STS에서 Gradle 사용 시 QueryDSL QClass 생성 설정 (0) | 2022.03.27 |
[Hadoop] VirtualBox 에 HDP Sandbox 환경 구축 (0) | 2021.12.02 |