Maven web project 만들기
1) File >> new Project를 선택하고 창이 열리면 아래와 같이 Maven Project를 선택한다.
2) 저장위치를 선택
3) maven proejct의 종류를 선택한다. 여기서는 web 프로젝트이므로 maven-archetype-webapp를 선택 함.
4) 프로젝트의 기본정보를 입력함.
Group Id : 프로젝트의 식별 문자열
Artifact Id: 하위 프로젝트 구분을 입력(프로젝트명)
5) 생성이 완료된 프로젝트 모습
java/main/resources => logback.xml,properties 파일들이 위치함
java/main/webapp => web ROOT 폴더
6) 프로젝트의 pom.xml파일을 열어 추가한다.
7) 추가가 완료되면 프로젝트 >오른쪽 마우스 클릭 > Maven > Update Project.. 를 선택하여 jar파일 업데이트를 진행한다.
8) 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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.my</groupId> <artifactId>FrameWork</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>FrameWork</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>4.2.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.2.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.2.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.2.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>4.2.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.2.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.2.4.RELEASE</version> </dependency> </dependencies> </project>
|