Skip to content

Commit 4803b71

Browse files
committed
Merge pull request spring-projects#125 from faissalwise/bower
moving from Webjars to Bower spring-projects#83
2 parents a768e87 + 540d31e commit 4803b71

File tree

6 files changed

+49
-31
lines changed

6 files changed

+49
-31
lines changed

.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "src/main/webapp/bower_components"
3+
}

bower.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "spring-petclinic",
3+
"authors": [
4+
"ihabritane.faycal@gmail.com"
5+
],
6+
"dependencies": {
7+
"bootstrap": "~2.3.0",
8+
"jquery": "~2.0.3",
9+
"jquery-ui": "~1.10.3"
10+
}
11+
}

pom.xml

+29-20
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
<mysql-driver.version>5.1.36</mysql-driver.version>
3737

3838
<!-- Web dependencies -->
39-
<webjars-bootstrap.version>2.3.0</webjars-bootstrap.version>
40-
<webjars-jquery-ui.version>1.10.3</webjars-jquery-ui.version>
41-
<webjars-jquery.version>2.0.3-1</webjars-jquery.version>
4239
<dandelion.version>1.1.1</dandelion.version>
4340
<dandelion.datatables.version>1.1.0</dandelion.datatables.version>
4441

@@ -223,23 +220,7 @@
223220
</exclusion>
224221
</exclusions>
225222
</dependency>
226-
<!-- Webjars (static dependencies distributed as JAR files) -->
227-
<dependency>
228-
<groupId>org.webjars</groupId>
229-
<artifactId>bootstrap</artifactId>
230-
<version>${webjars-bootstrap.version}</version>
231-
</dependency>
232-
<dependency>
233-
<groupId>org.webjars</groupId>
234-
<artifactId>jquery-ui</artifactId>
235-
<version>${webjars-jquery-ui.version}</version>
236-
</dependency>
237-
<dependency>
238-
<groupId>org.webjars</groupId>
239-
<artifactId>jquery</artifactId>
240-
<version>${webjars-jquery.version}</version>
241-
</dependency>
242-
223+
243224
<!-- Test Artifacts -->
244225
<dependency>
245226
<groupId>org.springframework</groupId>
@@ -408,6 +389,34 @@
408389
</plugin>
409390
</plugins>
410391
</reporting>
392+
<profiles>
393+
<profile>
394+
<id>bower-install</id>
395+
<build>
396+
<plugins>
397+
<plugin>
398+
<groupId>org.codehaus.mojo</groupId>
399+
<artifactId>exec-maven-plugin</artifactId>
400+
<executions>
401+
<execution>
402+
<phase>generate-sources</phase>
403+
<goals>
404+
<goal>exec</goal>
405+
</goals>
406+
</execution>
407+
</executions>
408+
<configuration>
409+
<executable>bower</executable>
410+
<arguments>
411+
<argument>install</argument>
412+
</arguments>
413+
<workingDirectory>${basedir}</workingDirectory>
414+
</configuration>
415+
</plugin>
416+
</plugins>
417+
</build>
418+
</profile>
419+
</profiles>
411420

412421
<url>demopetclinic</url>
413422
</project>

src/main/resources/spring/mvc-core-config.xml

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
(see header.jsp for more details) -->
2929
<mvc:resources mapping="/resources/**" location="/resources/"/>
3030

31-
<!-- uses WebJars so Javascript and CSS libs can be declared as Maven dependencies (Bootstrap, jQuery...) -->
32-
<mvc:resources mapping="/webjars/**" location="classpath:/META-INF/resources/webjars/"/>
33-
3431
<mvc:view-controller path="/" view-name="welcome"/>
3532

3633
<!-- serve static resources (*.html, ...) from src/main/webapp/

src/main/webapp/WEB-INF/jsp/fragments/staticFiles.jsp

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@ PetClinic :: a Spring Framework demonstration
99
<title>PetClinic :: a Spring Framework demonstration</title>
1010

1111

12-
<spring:url value="/webjars/bootstrap/2.3.0/css/bootstrap.min.css" var="bootstrapCss"/>
12+
<spring:url value="/bower_components/bootstrap/docs/assets/css/bootstrap.css" var="bootstrapCss"/>
1313
<link href="${bootstrapCss}" rel="stylesheet"/>
1414

1515
<spring:url value="/resources/css/petclinic.css" var="petclinicCss"/>
1616
<link href="${petclinicCss}" rel="stylesheet"/>
1717

18-
<spring:url value="/webjars/jquery/2.0.3/jquery.js" var="jQuery"/>
18+
<spring:url value="/bower_components/jquery/jquery.js" var="jQuery"/>
1919
<script src="${jQuery}"></script>
2020

2121
<!-- jquery-ui.js file is really big so we only load what we need instead of loading everything -->
22-
<spring:url value="/webjars/jquery-ui/1.10.3/ui/jquery.ui.core.js" var="jQueryUiCore"/>
22+
<spring:url value="/bower_components/query-ui/ui/jquery.ui.core.js" var="jQueryUiCore"/>
2323
<script src="${jQueryUiCore}"></script>
2424

25-
<spring:url value="/webjars/jquery-ui/1.10.3/ui/jquery.ui.datepicker.js" var="jQueryUiDatePicker"/>
25+
<spring:url value="/bower_components/query-ui/ui/jquery.ui.datepicker.js" var="jQueryUiDatePicker"/>
2626
<script src="${jQueryUiDatePicker}"></script>
2727

2828
<!-- jquery-ui.css file is not that big so we can afford to load it -->
29-
<spring:url value="/webjars/jquery-ui/1.10.3/themes/base/jquery-ui.css" var="jQueryUiCss"/>
29+
<spring:url value="/bower_components/query-ui/themes/base/jquery.ui.base.css" var="jQueryUiCss"/>
3030
<link href="${jQueryUiCss}" rel="stylesheet"></link>
3131
</head>
32-
33-

src/test/jmeter/petclinic_test_plan.jmx

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
<stringProp name="HTTPSampler.response_timeout"></stringProp>
136136
<stringProp name="HTTPSampler.protocol"></stringProp>
137137
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
138-
<stringProp name="HTTPSampler.path">${CONTEXT_WEB}/webjars/jquery/2.0.3/jquery.js</stringProp>
138+
<stringProp name="HTTPSampler.path">${CONTEXT_WEB}/bower_components/jquery/jquery.js</stringProp>
139139
<stringProp name="HTTPSampler.method">GET</stringProp>
140140
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
141141
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>

0 commit comments

Comments
 (0)