본문으로 바로가기

[JSP] Maven 이란??

category Dev/JSP 2018. 5. 29. 13:51

Maven?

반복적으로 진행해왔던 작업들을 지원하기 위하여 등장한 도구

Coc에 대해서 먼저 이해를 해야함!

# CoC (Convention over Configuration) : 일종의 관습으로, 소스파일은 어느위치에 있어야하고 컴파일된 파일은 어디에 있어야 하는 등 미리 정해둔 것


[ pom.xml ]

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<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>kr.or.connect</groupId>
  <artifactId>webapiexam</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>webapiexam Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <properties>
    <!-- web.xml 파일을 삭제해도 eclipse에서 오류가 발생하지 않는다. -->
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </properties>
  <dependencies>
    <!-- MySQL 라이브러리 -->
    <dependency>
       <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.45</version>
    </dependency>
 
    <!-- json 라이브러리 databind jackson-core, jackson-annotaion에 의존성이 있다. -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.9.4</version>
    </dependency>
 
    <!-- Servlet 라이브러리 -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
 
    <!-- JSTL 라이브러리 -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
 
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
   <finalName>webapiexam</finalName>
    <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
         <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
 
 cs


[ web.xml ]

1
2
3
4
5
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
  <display-name>Archetype Created Web Application</display-name>
</web-app>
cs


.settings/org.eclipse.wst.common.project.facet.core.xml ]

1
2
3
4
5
6
7
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="jst.web" version="3.1"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="java" version="1.8"/>
</faceted-project>
cs


'Dev > JSP' 카테고리의 다른 글

[JSP] Spring  (0) 2018.07.19
[JSP] JDBC 사용하기!!  (0) 2018.05.29
[JSP] EL & JSTL  (0) 2018.05.26
[JSP] Scope  (0) 2018.05.24
[JSP] 내장객체와 Redirect & Forward  (0) 2018.05.23