Skip to content

Commit 4aee9a8

Browse files
authored
Bootstrap 5 with SCSS migration (#273)
* Bootstrap 5 with SCSS migration * Bump Angular version * Remove class="container"
1 parent 09172e9 commit 4aee9a8

19 files changed

+9977
-344
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ mvn clean install -Dmaven.test.skip -P buildDocker -Ddocker.image.prefix=${REPOS
200200
The `scripts/pushImages.sh` and `scripts/tagImages.sh` shell scripts could also be used once you build your image with the `buildDocker` maven profile.
201201
The `scripts/tagImages.sh` requires to declare the `VERSION` env variable.
202202

203+
## Compiling the CSS
204+
205+
There is a `petclinic.css` in `spring-petclinic-api-gateway/src/main/resources/static/css`.
206+
It was generated from the `petclinic.scss` source, combined with the [Bootstrap](https://getbootstrap.com/) library.
207+
If you make changes to the `scss`, or upgrade Bootstrap, you will need to re-compile the CSS resources
208+
using the Maven profile `css` of the `spring-petclinic-api-gateway`module.
209+
```bash
210+
cd spring-petclinic-api-gateway
211+
mvn generate-resources -P css
212+
```
213+
203214
## Interesting Spring Petclinic forks
204215

205216
The Spring Petclinic `main` branch in the main [spring-projects](https://github.com/spring-projects/spring-petclinic)

spring-petclinic-api-gateway/pom.xml

+59-50
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
</parent>
1616

1717
<properties>
18-
<!-- Any bootstrap version upgrade must be reported in the wro4j.xml file -->
19-
<webjars-bootstrap.version>3.4.0</webjars-bootstrap.version>
20-
<webjars-jquery.version>3.6.0</webjars-jquery.version>
21-
<webjars-angular.version>1.8.2</webjars-angular.version>
22-
<webjars-angular-ui-router.version>1.0.20</webjars-angular-ui-router.version>
23-
<wro4j.version>1.8.0</wro4j.version>
18+
<webjars-bootstrap.version>5.3.3</webjars-bootstrap.version>
19+
<webjars-font-awesome.version>4.7.0</webjars-font-awesome.version>
20+
<webjars-angular.version>1.8.3</webjars-angular.version>
21+
<webjars-angular-ui-router.version>1.0.30</webjars-angular-ui-router.version>
22+
<libsass-maven-plugin.version>0.2.29</libsass-maven-plugin.version>
2423
<docker.image.exposed.port>8081</docker.image.exposed.port>
2524
<docker.image.dockerfile.dir>${basedir}/../docker</docker.image.dockerfile.dir>
2625
</properties>
@@ -107,9 +106,9 @@
107106
<version>${webjars-angular.version}</version>
108107
</dependency>
109108
<dependency>
110-
<groupId>org.webjars</groupId>
111-
<artifactId>jquery</artifactId>
112-
<version>${webjars-jquery.version}</version>
109+
<groupId>org.webjars.npm</groupId>
110+
<artifactId>font-awesome</artifactId>
111+
<version>${webjars-font-awesome.version}</version>
113112
</dependency>
114113
<dependency>
115114
<groupId>org.webjars</groupId>
@@ -144,47 +143,6 @@
144143
</dependency>
145144
</dependencies>
146145

147-
<build>
148-
<plugins>
149-
<plugin>
150-
<groupId>ro.isdc.wro4j</groupId>
151-
<artifactId>wro4j-maven-plugin</artifactId>
152-
<version>${wro4j.version}</version>
153-
<executions>
154-
<execution>
155-
<!-- Configuration tips for VS Code in Dev Container -->
156-
<?m2e execute onConfiguration?>
157-
<phase>generate-resources</phase>
158-
<goals>
159-
<goal>run</goal>
160-
</goals>
161-
</execution>
162-
</executions>
163-
<configuration>
164-
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
165-
<cssDestinationFolder>${project.build.directory}/classes/static/css</cssDestinationFolder>
166-
<wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
167-
<extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
168-
<contextFolder>${basedir}/src/main/less</contextFolder>
169-
</configuration>
170-
<dependencies>
171-
<dependency>
172-
<groupId>org.webjars</groupId>
173-
<artifactId>bootstrap</artifactId>
174-
<version>${webjars-bootstrap.version}</version>
175-
</dependency>
176-
<!-- Some tweak for wro4j 1.8 compatibility with Java 9+ -->
177-
<!-- See https://github.com/wro4j/wro4j/issues/1039 -->
178-
<dependency>
179-
<groupId>org.mockito</groupId>
180-
<artifactId>mockito-core</artifactId>
181-
<version>${mockito.version}</version>
182-
</dependency>
183-
</dependencies>
184-
</plugin>
185-
</plugins>
186-
</build>
187-
188146
<profiles>
189147
<profile>
190148
<id>buildDocker</id>
@@ -197,5 +155,56 @@
197155
</plugins>
198156
</build>
199157
</profile>
158+
<profile>
159+
<id>css</id>
160+
<build>
161+
<plugins>
162+
<plugin>
163+
<groupId>org.apache.maven.plugins</groupId>
164+
<artifactId>maven-dependency-plugin</artifactId>
165+
<executions>
166+
<execution>
167+
<id>unpack</id>
168+
<?m2e execute onConfiguration,onIncremental?>
169+
<phase>generate-resources</phase>
170+
<goals>
171+
<goal>unpack</goal>
172+
</goals>
173+
<configuration>
174+
<artifactItems>
175+
<artifactItem>
176+
<groupId>org.webjars.npm</groupId>
177+
<artifactId>bootstrap</artifactId>
178+
<version>${webjars-bootstrap.version}</version>
179+
</artifactItem>
180+
</artifactItems>
181+
<outputDirectory>${project.build.directory}/webjars</outputDirectory>
182+
</configuration>
183+
</execution>
184+
</executions>
185+
</plugin>
186+
187+
<plugin>
188+
<groupId>com.gitlab.haynes</groupId>
189+
<artifactId>libsass-maven-plugin</artifactId>
190+
<version>${libsass-maven-plugin.version}</version>
191+
<executions>
192+
<execution>
193+
<phase>generate-resources</phase>
194+
<?m2e execute onConfiguration,onIncremental?>
195+
<goals>
196+
<goal>compile</goal>
197+
</goals>
198+
</execution>
199+
</executions>
200+
<configuration>
201+
<inputPath>${basedir}/src/main/resources/static/scss/</inputPath>
202+
<outputPath>${basedir}/src/main/resources/static/css/</outputPath>
203+
<includePath>${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/</includePath>
204+
</configuration>
205+
</plugin>
206+
</plugins>
207+
</build>
208+
</profile>
200209
</profiles>
201210
</project>

0 commit comments

Comments
 (0)