This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pom.xml
452 lines (451 loc) · 22.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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>gov.osti</groupId>
<artifactId>doecode</artifactId>
<version>3.2.0</version>
<name>DOE CODE Web Application (Client)</name>
<packaging>war</packaging>
<properties>
<session_timeout>45</session_timeout>
<app_name>${project.artifactId}</app_name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!--Timestamp is used to give a unique name to javascript files upon build time-->
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy.MM.dd.HH.mm.ss</maven.build.timestamp.format>
<log_level>WARN</log_level>
<skip_minify>false</skip_minify>
</properties>
<!--
You will need to add your own profiles into this pom.xml, or use profiles stored in your local settings.xml
<profile>
<id>profile-name</id>
<properties>
<environment>Name of the properties file you're pulling values from</environment>
<username>Username of the tomcat manager you deploy the application to</username>
<password>Password of the tomcat manager you deploy the application to</password>
<apiURL>The URL to the DOECODE API instance that you use</apiURL>
<apiBackendURL>The URL the java side of the application uses to call the DOE CODE API. </apiBackendURL>
(This separation is optional, and is mainly used for those that have the DOE CODE running locally and prefer to access it via localhost on the java side.
If you don't have the api running on the same tomcat, make this value the same as your api_url)
<siteURL>The base url for the site</siteURL>
<authorityapiURL>The base URL for OSTI's Elink Authority API</authorityapiURL>
<app_name>The base name of the app. "doecode" by default</app_name>
<smtpHost>The host used to send emails from the application</smtpHost>
<gitlab_submit_email>The email address gitlab submissions are sent to</gitlab_submit_email>
<gitlab_from_email>The email address gitlab submissions are from</gitlab_from_email>
<gitlab_recaptcha_site_key>The public key attached to recaptcha instances</gitlab_recaptcha_site_key>
<gitlab_recaptcha_secret_key>The private key attached to recaptcha submissions</gitlab_recaptcha_secret_key>
<google_analytics_4_id>The public ID used for google analytics 4 submissions</google_analytics_4_id>
<log_level>The level of log for a particular build. Could be debug, info, warn, error, etc</log_level>
</properties>
</profile>
-->
<build>
<finalName>${app_name}</finalName>
<resources>
<!--Copies to classes directory-->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- enforce min version -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.0.5</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- support checking for latest versions -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<rulesUri>file:///${project.basedir}/plugin_rules.xml</rulesUri>
</configuration>
</plugin>
<!--
This plugin is used as a way for several developers to utilize the same project and configurations. To use it, you must have an application in the location
specified in <file>. The properties from that file are loaded as maven properties. This is meant to be a replacement to using traditional maven profiles located
in the pom.xml or in a .m2/settings.xml
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${user.home}/shared-resources/doecode/application.properties</file>
<file>${user.home}/shared-resources/doecode/${environment}.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.6</version>
<executions>
<!--Minify Javascript Files-->
<!--
Each javascript file is minified individually, and is only included on the pages wherever it's specified.
For example, input.js is only included on the input form
-->
<execution>
<id>minify-base</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>doecode.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>doecode.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-dissemination</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>dissemination.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>dissemination.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-input</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>input.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>input.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-input-other</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>input-other.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>input-other.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-user</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>user.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>user.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-utils</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js/utils</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>utils.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>utils.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-other</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>other.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>other.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<execution>
<id>minify-site</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>site.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>site.${timestamp}.js</jsFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
<!--Minify The base css file-->
<execution>
<id>minify-everything-css</id>
<phase>compile</phase>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
<webappTargetDir>${basedir}/target/${app_name}/</webappTargetDir>
<cssSourceDir>css</cssSourceDir>
<cssSourceFiles>
<cssSourceFile>purecss/purecss.min.css</cssSourceFile>
<cssSourceFile>bootstrap/css/bootstrap.min.css</cssSourceFile>
<cssSourceFile>doecode.css</cssSourceFile>
<cssSourceFile>doecode-media-queries.css</cssSourceFile>
</cssSourceFiles>
<cssFinalFile>doecode-css.${timestamp}.css</cssFinalFile>
<nosuffix>true</nosuffix>
<jsEngine>CLOSURE</jsEngine>
<closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
<skipMinify>${skip_minify}</skipMinify>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
The properties for this could either be located here in the pom.xml, or in the settings.xml in your maven .m2 directory
Example:
<servers>
<server>
<id>[ID Goes Here]</id>
<username>tomcat username</username>
<password>tomcat password</password>
</server>
</serers>
<profiles>
<profile>
<id>[Id of profile, the value you put after -P when calling maven]</id>
<properties>
<server>[Id of server you declared above]</server>
<host>URL to tomcat you're deploying to</host>
<port>Port of tomcat you're deploying to</port>
<environment>Name of properties file you're loading in the properties-maven-plugin</environment>
</properties>
</profile>
</profiles>
-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>${server}</server>
<url>http://${host}:${port}/manager/text</url>
<warFile>${project.build.directory}/${app_name}.war</warFile>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!--Building Plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<warSourceExcludes>**/dissemination.js,**/doecode.js,**/input-other.js,**/input.js,**/other.js,**/site.js,**/user.js,**/utils.js,**/doecode.css,**/doecode-media-queries.css</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!--Servlet API-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
<!--Templating-->
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars-jackson2</artifactId>
<version>4.3.1</version>
</dependency>
<!--Jackson Library for JSON-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
<!--Jsoup (for scrubbing out script tags to prevent XSS attacks)-->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.16.1</version>
</dependency>
<!--Logging-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.3.11</version>
</dependency>
<!--Used for HTTP calls (not all use this yet. They are being transitioned)-->
<dependency>
<groupId>org.javalite</groupId>
<artifactId>javalite-common</artifactId>
<version>2.6-j8</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- -->
<!--APACHE LIBRARIES-->
<!-- -->
<dependency>
<!--Used for most string manipulation, null checking, etc-->
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.13.0</version>
</dependency>
<dependency>
<!--Used to get data from google during the captcha process-->
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
</dependency>
<dependency>
<!--Used for email sending-->
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<!--Used for base-64 encoding the user data into a cookie-->
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.16.0</version>
</dependency>
</dependencies>
</project>