ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Spring MVC를 위한 기본 라이브러리 세팅 (pom.xml)
    Spring/초기 설정 2021. 12. 24. 22:42
    반응형

    [Spring] Spring 개발환경 설정 - MangKyu's Diary (tistory.com) 참고 블로그

     

    Step 1. 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>
    
      <groupId>com.maven.spring.study</groupId>
      <artifactId>proj5</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
    
      <name>proj1 Maven Webapp</name>
      <!-- FIXME change it to the project's website -->
      <url>http://www.example.com</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    	<javax.servlet-version>4.0.1</javax.servlet-version>
    	<javax.servlet.jsp.jstl-version>1.2</javax.servlet.jsp.jstl-version>
    	<org.springframework-version>5.2.2.RELEASE</org.springframework-version>
    	<org.apache.tomcat-version>9.0.55</org.apache.tomcat-version>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.11</version>
          <scope>test</scope>
        </dependency>
    	<dependency>
    		<groupId>org.apache.tomcat</groupId>
    		<artifactId>tomcat-api</artifactId>
    		<version>${org.apache.tomcat-version}</version>
    		<type>pom.sha512</type>
    	</dependency>
    	<dependency>
    		<groupId>javax.servlet</groupId>
    		<artifactId>jstl</artifactId>
    		<version>${javax.servlet.jsp.jstl-version}</version>
    	</dependency>
    
    	<dependency>
    		<groupId>org.springframework</groupId>
    		<artifactId>spring-webmvc</artifactId>
    		<version>${org.springframework-version}</version>
    	</dependency>
      <!--
    	<dependency>
    		<groupId>javax.servlet</groupId>
    		<artifactId>javax.servlet-api</artifactId>
    		<version>4.0.1</version>
    	</dependency>
      -->
      </dependencies>
      
    
      <build>
        <finalName>proj5</finalName>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
          <plugins>
            <plugin>
              <artifactId>maven-clean-plugin</artifactId>
              <version>3.1.0</version>
            </plugin>
            <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <version>3.0.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.8.0</version>
            </plugin>
            <plugin>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.22.1</version>
            </plugin>
            <plugin>
              <artifactId>maven-war-plugin</artifactId>
              <version>3.2.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-install-plugin</artifactId>
              <version>2.5.2</version>
            </plugin>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>2.8.2</version>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </project>

     

    반응형

    'Spring > 초기 설정' 카테고리의 다른 글

    Spring MVC 세팅 - Java로 셋팅  (0) 2021.12.25
    Spring MVC 세팅 - xml 설정  (0) 2021.12.25

    댓글

Designed by Tistory.