Skip to content

Commit 15426e8

Browse files
committed
Create Spring MVC Project with Maven
1 parent ffab8dc commit 15426e8

21 files changed

+343
-0
lines changed

spring-mvc-maven/.classpath

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="test" value="true"/>
17+
<attribute name="optional" value="true"/>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
25+
</attributes>
26+
</classpathentry>
27+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
28+
<attributes>
29+
<attribute name="maven.pomderived" value="true"/>
30+
</attributes>
31+
</classpathentry>
32+
<classpathentry kind="output" path="target/classes"/>
33+
</classpath>

spring-mvc-maven/.project

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>spring-mvc-maven</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.springframework.ide.eclipse.core.springbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
<buildCommand>
34+
<name>org.eclipse.m2e.core.maven2Builder</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
38+
</buildSpec>
39+
<natures>
40+
<nature>org.springframework.ide.eclipse.core.springnature</nature>
41+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
42+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
43+
<nature>org.eclipse.jdt.core.javanature</nature>
44+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
45+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
46+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
47+
</natures>
48+
</projectDescription>

spring-mvc-maven/.settings/.jsdtscope

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
4+
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
5+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
6+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
7+
<attributes>
8+
<attribute name="hide" value="true"/>
9+
</attributes>
10+
</classpathentry>
11+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
12+
<classpathentry kind="output" path=""/>
13+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
13+
org.eclipse.jdt.core.compiler.release=disabled
14+
org.eclipse.jdt.core.compiler.source=1.8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2+
<wb-module deploy-name="spring-mvc-maven">
3+
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
4+
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
5+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
6+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
7+
<property name="context-root" value="spring-mvc-maven"/>
8+
<property name="java-output-path" value="/spring-mvc-maven/target/classes"/>
9+
</wb-module>
10+
</project-modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<fixed facet="wst.jsdt.web"/>
4+
<installed facet="jst.web" version="3.0"/>
5+
<installed facet="wst.jsdt.web" version="1.0"/>
6+
<installed facet="java" version="1.8"/>
7+
</faceted-project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Window
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled=06target
2+
eclipse.preferences.version=1

spring-mvc-maven/pom.xml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>jbr.springmvc</groupId>
6+
<artifactId>spring-mvc-maven</artifactId>
7+
<packaging>war</packaging>
8+
<version>0.1</version>
9+
<name>spring-mvc-maven Maven Webapp</name>
10+
<url>http://maven.apache.org</url>
11+
12+
<properties>
13+
<java.version>1.8</java.version>
14+
</properties>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.springframework</groupId>
19+
<artifactId>spring-webmvc</artifactId>
20+
<version>5.0.7.RELEASE</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>javax.servlet</groupId>
24+
<artifactId>javax.servlet-api</artifactId>
25+
<version>4.0.1</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>junit</groupId>
29+
<artifactId>junit</artifactId>
30+
<version>3.8.1</version>
31+
<scope>test</scope>
32+
</dependency>
33+
</dependencies>
34+
35+
<build>
36+
<finalName>spring-mvc-maven</finalName>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-compiler-plugin</artifactId>
41+
<configuration>
42+
<source>${java.version}</source>
43+
<target>${java.version}</target>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package jbr.springmvc.gradle;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.ui.ModelMap;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
@Controller
8+
public class HelloController {
9+
10+
@RequestMapping("/hello")
11+
public String hello(ModelMap map) {
12+
map.put("message", "HELLO. Welcome to Spring MVC using GRADLE!!!");
13+
return "hello";
14+
}
15+
16+
@RequestMapping("/bye")
17+
public String bye(ModelMap map) {
18+
map.put("message", "GOOD BYE. Meet you soon!!!");
19+
return "bye";
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:context="http://www.springframework.org/schema/context"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="
6+
http://www.springframework.org/schema/beans
7+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
8+
http://www.springframework.org/schema/context
9+
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
10+
11+
<context:component-scan
12+
base-package="jbr.springmvc" />
13+
<context:annotation-config />
14+
15+
<bean
16+
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
17+
<property name="prefix" value="/jsp/" />
18+
<property name="suffix" value=".jsp" />
19+
</bean>
20+
21+
</beans>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://java.sun.com/xml/ns/javaee"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
5+
version="3.0">
6+
7+
<display-name>Archetype Created Web Application</display-name>
8+
9+
<welcome-file-list>
10+
<welcome-file>index.jsp</welcome-file>
11+
</welcome-file-list>
12+
13+
<servlet>
14+
<servlet-name>spring-mvc</servlet-name>
15+
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
16+
<load-on-startup>1</load-on-startup>
17+
</servlet>
18+
<servlet-mapping>
19+
<servlet-name>spring-mvc</servlet-name>
20+
<url-pattern>/</url-pattern>
21+
</servlet-mapping>
22+
23+
<!-- <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-mvc-servlet.xml</param-value>
24+
</context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
25+
</listener> -->
26+
</web-app>
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta charset="ISO-8859-1">
6+
<title>Insert title here</title>
7+
</head>
8+
<body>
9+
10+
<a href="hello">Say HELLO</a>
11+
<a href="bye">Say BYE</a>
12+
13+
</body>
14+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta charset="ISO-8859-1">
6+
<title>Insert title here</title>
7+
</head>
8+
<body>${message}
9+
</body>
10+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta charset="ISO-8859-1">
6+
<title>Insert title here</title>
7+
</head>
8+
<body>${message}
9+
</body>
10+
</html>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Manifest-Version: 1.0
2+
Built-By: RANJITHS
3+
Build-Jdk: 1.8.0_91
4+
Created-By: Maven Integration for Eclipse
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Generated by Maven Integration for Eclipse
2+
#Mon Jul 16 20:32:11 IST 2018
3+
version=0.1
4+
groupId=jbr.springmvc
5+
m2e.projectName=spring-mvc-maven
6+
m2e.projectLocation=C\:\\ranjiths\\jbr\\ws\\spring-mvc-maven
7+
artifactId=spring-mvc-maven
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>jbr.springmvc</groupId>
6+
<artifactId>spring-mvc-maven</artifactId>
7+
<packaging>war</packaging>
8+
<version>0.1</version>
9+
<name>spring-mvc-maven Maven Webapp</name>
10+
<url>http://maven.apache.org</url>
11+
12+
<properties>
13+
<java.version>1.8</java.version>
14+
</properties>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.springframework</groupId>
19+
<artifactId>spring-webmvc</artifactId>
20+
<version>5.0.7.RELEASE</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>javax.servlet</groupId>
24+
<artifactId>javax.servlet-api</artifactId>
25+
<version>4.0.1</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>junit</groupId>
29+
<artifactId>junit</artifactId>
30+
<version>3.8.1</version>
31+
<scope>test</scope>
32+
</dependency>
33+
</dependencies>
34+
35+
<build>
36+
<finalName>spring-mvc-maven</finalName>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-compiler-plugin</artifactId>
41+
<configuration>
42+
<source>${java.version}</source>
43+
<target>${java.version}</target>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
</project>

0 commit comments

Comments
 (0)