Skip to content

Commit 4777996

Browse files
authored
Merge pull request eugenp#459 from bhaskey/master
webjars demo project added
2 parents 8392bbc + bae9bf8 commit 4777996

5 files changed

Lines changed: 127 additions & 0 deletions

File tree

‎webjars/webjarsdemo/pom.xml‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.baeldung</groupId>
7+
<artifactId>webjarsdemo</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>webjarsdemo</name>
12+
<description>Demo project for webjars using Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.3.5.RELEASE</version>
18+
<relativePath /> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<java.version>1.8</java.version>
24+
</properties>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-web</artifactId>
34+
</dependency>
35+
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter-test</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.webjars</groupId>
43+
<artifactId>bootstrap</artifactId>
44+
<version>3.3.4</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.webjars</groupId>
48+
<artifactId>jquery</artifactId>
49+
<version>2.1.4</version>
50+
</dependency>
51+
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
62+
63+
</project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.baeldung;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.ui.Model;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
@Controller
8+
public class TestController {
9+
10+
@RequestMapping(value="/")
11+
public String welcome(Model model){
12+
return "index";
13+
}
14+
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class WebjarsdemoApplication {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(WebjarsdemoApplication.class, args);
11+
}
12+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<html>
2+
<head>
3+
<title>WebJars Demo</title>
4+
<link rel="stylesheet" href="/webjars/bootstrap/3.3.4/css/bootstrap.min.css" />
5+
</head>
6+
<body>
7+
8+
<div class="container"><br/>
9+
<div class="alert alert-success">
10+
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
11+
<strong>Success!</strong> It is working as we expected.
12+
</div>
13+
</div>
14+
15+
<script src="/webjars/jquery/2.1.4/jquery.min.js"></script>
16+
<script src="/webjars/bootstrap/3.3.4/js/bootstrap.min.js"></script>
17+
18+
</body>
19+
</html>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.SpringApplicationConfiguration;
6+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
7+
import org.springframework.test.context.web.WebAppConfiguration;
8+
9+
@RunWith(SpringJUnit4ClassRunner.class)
10+
@SpringApplicationConfiguration(classes = WebjarsdemoApplication.class)
11+
@WebAppConfiguration
12+
public class WebjarsdemoApplicationTests {
13+
14+
@Test
15+
public void contextLoads() {
16+
}
17+
18+
}

0 commit comments

Comments
 (0)