-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.xml
301 lines (287 loc) · 14.5 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<?xml version="1.0" encoding="UTF-8"?>
<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>eu.clarin.style</groupId>
<artifactId>base-style</artifactId>
<version>${style.version}</version>
<packaging>jar</packaging>
<properties>
<style.version>${env.STYLE_VERSION}</style.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bootstrap.version>${env.BOOTSTRAP_VER}</bootstrap.version>
<less.sourcedir>${project.build.directory}/less</less.sourcedir>
<less.outputname>bootstrap-clarin.css</less.outputname>
<bootstrap.tempdir>${project.build.directory}/temp/bootstrap</bootstrap.tempdir>
<bootstrap.srcdir>META-INF/resources/webjars/bootstrap/${bootstrap.version}</bootstrap.srcdir>
</properties>
<build>
<plugins>
<!-- Common build step 1: extract the bootstrap less sources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${bootstrap.tempdir}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Common build step 2: copy bootstrapp LESS sources and variables.less into a common place -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${less.sourcedir}</outputDirectory>
<resources>
<resource>
<!-- Bootstrap LESS sources unpacked by the maven-dependency-plugin -->
<directory>${bootstrap.tempdir}/${bootstrap.srcdir}/less</directory>
<excludes>
<!-- Exclude the variables file, we will use our style's version instead! -->
<exclude>variables.less</exclude>
</excludes>
</resource>
<resource>
<!-- Our variables.less file, to be mixed with Bootstrap LESS sources -->
<directory>src/main/less</directory>
<includes>
<include>variables.less</include>
<include>clarin-additions.less</include>
<include>clarin-bootstrap.less</include>
<include>clarin-fonts.less</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-fonts</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/fonts</outputDirectory>
<resources>
<resource>
<!-- Our variables.less file, to be mixed with Bootstrap LESS sources -->
<directory>src/main/fonts</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Final step: make a jar -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>${jar.classifier}</classifier>
</configuration>
</execution>
</executions>
<!-- TODO: only build and/or deploy artifact with classifier
http://maven.40175.n5.nabble.com/Error-400-when-deploying-releases-to-Nexus-td3201051.html
-->
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Profile that creates an artifact with a single compiled CSS file -->
<id>css-with-bootstrap</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<jar.classifier>css-with-bootstrap</jar.classifier>
</properties>
<build>
<directory>target-css-with-bootstrap</directory>
<resources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}</directory>
</resource>
</resources>
<plugins>
<!-- Step 3: copy bootstrap files except for LESS sources to build output -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources-for-css</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
<resources>
<resource>
<!-- Bootstrap fonts and scripts to be bundled with compiled CSS -->
<directory>${bootstrap.tempdir}/${bootstrap.srcdir}/dist</directory>
<includes>
<include>fonts/**</include>
<include>js/**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Step 4: compile LESS files (mixed together in the previous stepps) into .css -->
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.7.0.1.1</version>
<configuration>
<sourceDirectory>${less.sourcedir}</sourceDirectory>
<outputDirectory>${project.build.directory}/${project.build.finalName}/css</outputDirectory>
<outputFileFormat>${less.outputname}</outputFileFormat>
<compress>true</compress>
<force>true</force>
<includes>
<include>clarin-bootstrap.less</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Profile that creates an artifact with a single compiled CSS file -->
<id>less-with-bootstrap</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<jar.classifier>less-with-bootstrap</jar.classifier>
</properties>
<build>
<directory>target-less-with-bootstrap</directory>
<resources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}</directory>
</resource>
</resources>
<plugins>
<!-- Step 3: copy bootstrap files + customisation to build output -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<!-- Copy licence file and fonts to project output -->
<execution>
<id>copy-resources-for-less</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
<resources>
<resource>
<!-- Bootstrap fonts and scripts to be bundled with compiled CSS -->
<directory>${bootstrap.tempdir}/${bootstrap.srcdir}/dist</directory>
<includes>
<include>fonts/**</include>
<include>js/**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<!-- Copy customised less sources to /less -->
<execution>
<id>copy-less</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/less</outputDirectory>
<resources>
<resource>
<!-- Bootstrap licence and fonts to be bundled with compiled CSS -->
<directory>${less.sourcedir}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Profile that creates an artifact that only contains the CLARIN LESS files -->
<id>less-without-bootstrap</id>
<properties>
<jar.classifier>less-without-bootstrap</jar.classifier>
</properties>
<build>
<directory>target-less-without-bootstrap</directory>
<resources>
<resource>
<directory>src/main/less</directory>
<includes>
<include>variables.less</include>
<include>clarin-additions.less</include>
<include>clarin-bootstrap.less</include>
</includes>
</resource>
</resources>
</build>
</profile>
</profiles>
<distributionManagement>
<snapshotRepository>
<id>CLARIN-Snapshot</id>
<url>https://nexus.clarin.eu/content/repositories/clarin-snapshot</url>
</snapshotRepository>
<repository>
<id>CLARIN</id>
<url>https://nexus.clarin.eu/content/repositories/Clarin</url>
</repository>
</distributionManagement>
</project>