Browse Source

Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share

leijie 8 years ago
parent
commit
36c5f81398

+ 635 - 0
display-server/pom.xml.boot

1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
5
	<parent>  
6
        <groupId>org.springframework.boot</groupId>  
7
        <artifactId>spring-boot-starter-parent</artifactId>
8
        <!-- <version>1.2.1.RELEASE</version> -->
9
        <version>1.4.0.RELEASE</version>
10
    </parent> 
11
    
12
    <!-- 定义公共变量 -->
13
    <properties>
14
        <encoding>UTF-8</encoding>
15
        <java.version>1.7</java.version>  
16
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
17
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>  
18
        <!-- Central jar -->
19
        <junit>3.8.1</junit>
20
        <servlet-api>3.0-alpha-1</servlet-api>
21
        <log4j>1.2.8</log4j>
22
        <unirest-java>1.3.8</unirest-java>
23
        <dom4j>1.6.1</dom4j>
24
        <jaxen>1.1.1</jaxen>
25
        <commons-lang3>3.4</commons-lang3>
26
        <beetl-core>2.2.3</beetl-core>
27
        <velocity>1.7</velocity>
28
        <jsoup>1.7.2</jsoup>
29
        <commons-fileupload>1.3.1</commons-fileupload>
30
        <commons-dbcp>1.4</commons-dbcp>
31
        <mysql-connector-java>5.1.39</mysql-connector-java>
32
        <commons-codec>1.3</commons-codec>
33
        <jdom>1.1.3</jdom>
34
        <commons-collections>3.2</commons-collections>
35
        <quartz-all>1.6.3</quartz-all>
36
        <jta>1.1</jta>
37
38
        <!-- 3rd party jar -->
39
        <ojdbc>14</ojdbc>
40
        <java_memcache-release>2.5.3</java_memcache-release>
41
        <amail>1.0</amail>
42
        <zxing>1.0</zxing>
43
        <!-- ipu jar -->
44
        <ipu>3.0</ipu>
45
        <wade>1.0</wade>
46
47
        <!-- 公共插件 -->
48
        <maven-clean-plugin>3.0.0</maven-clean-plugin>
49
        <maven-resources-plugin>3.0.1</maven-resources-plugin>
50
        <maven-compiler-plugin>3.1</maven-compiler-plugin>
51
        <compiler-version>1.6</compiler-version>
52
        <maven-surefire-plugin>2.5</maven-surefire-plugin>
53
        <maven-war-plugin>2.6</maven-war-plugin>
54
        <exec-maven-plugin>1.5.0</exec-maven-plugin>
55
        <maven-dependency-plugin>2.4</maven-dependency-plugin>
56
57
        <!-- 本地jar路径all -->
58
        <jar-path-all>${project.basedir}/all</jar-path-all>
59
60
    </properties>
61
62
    <dependencyManagement>
63
        <dependencies>
64
            <!-- Central jar -->
65
            <dependency>
66
                <groupId>commons-collections</groupId>
67
                <artifactId>commons-collections</artifactId>
68
                <version>${commons-collections}</version>
69
            </dependency>
70
            <dependency>
71
                <groupId>javax.transaction</groupId>
72
                <artifactId>jta</artifactId>
73
                <version>${jta}</version>
74
            </dependency>
75
            <dependency>
76
                <groupId>opensymphony</groupId>
77
                <artifactId>quartz-all</artifactId>
78
                <version>${quartz-all}</version>
79
            </dependency>
80
            <dependency>
81
                <groupId>junit</groupId>
82
                <artifactId>junit</artifactId>
83
                <version>${junit}</version>
84
                <scope>test</scope>
85
            </dependency>
86
            <dependency>
87
                <groupId>javax.servlet</groupId>
88
                <artifactId>servlet-api</artifactId>
89
                <version>${servlet-api}</version>
90
                <scope>provided</scope>
91
            </dependency>
92
            <dependency>
93
                <groupId>org.apache.commons</groupId>
94
                <artifactId>commons-lang3</artifactId>
95
                <version>${commons-lang3}</version>
96
            </dependency>
97
            <dependency>
98
                <groupId>log4j</groupId>
99
                <artifactId>log4j</artifactId>
100
                <version>${log4j}</version>
101
            </dependency>
102
            <dependency>
103
                <groupId>dom4j</groupId>
104
                <artifactId>dom4j</artifactId>
105
                <version>${dom4j}</version>
106
            </dependency>
107
            <dependency>
108
                <groupId>jaxen</groupId>
109
                <artifactId>jaxen</artifactId>
110
                <version>${jaxen}</version>
111
            </dependency>
112
            <dependency>
113
                <groupId>com.mashape.unirest</groupId>
114
                <artifactId>unirest-java</artifactId>
115
                <version>${unirest-java}</version>
116
            </dependency>
117
            <dependency>
118
                <groupId>org.beetl</groupId>
119
                <artifactId>beetl-core</artifactId>
120
                <version>${beetl-core}</version>
121
            </dependency>
122
            <dependency>
123
                <groupId>org.apache.velocity</groupId>
124
                <artifactId>velocity</artifactId>
125
                <version>${velocity}</version>
126
            </dependency>
127
            <dependency>
128
                <groupId>org.jsoup</groupId>
129
                <artifactId>jsoup</artifactId>
130
                <version>${jsoup}</version>
131
            </dependency>
132
            <dependency>
133
                <groupId>commons-fileupload</groupId>
134
                <artifactId>commons-fileupload</artifactId>
135
                <version>${commons-fileupload}</version>
136
            </dependency>
137
            <dependency>
138
                <groupId>commons-dbcp</groupId>
139
                <artifactId>commons-dbcp</artifactId>
140
                <version>${commons-dbcp}</version>
141
            </dependency>
142
            <dependency>
143
                <groupId>mysql</groupId>
144
                <artifactId>mysql-connector-java</artifactId>
145
                <version>${mysql-connector-java}</version>
146
            </dependency>
147
            <dependency>
148
                <groupId>commons-codec</groupId>
149
                <artifactId>commons-codec</artifactId>
150
                <version>${commons-codec}</version>
151
            </dependency>
152
153
            <!-- 3rd party jar -->
154
            <dependency>
155
                <groupId>com</groupId>
156
                <artifactId>java_memcache-release</artifactId>
157
                <version>${java_memcache-release}</version>
158
            </dependency>
159
            <dependency>
160
                <groupId>com.amail</groupId>
161
                <artifactId>amail</artifactId>
162
                <version>${amail}</version>
163
            </dependency>
164
            <dependency>
165
                <groupId>com.zxing</groupId>
166
                <artifactId>zxing</artifactId>
167
                <version>${zxing}</version>
168
            </dependency>
169
            <dependency>
170
                <groupId>ojdbc</groupId>
171
                <artifactId>ojdbc</artifactId>
172
                <version>${ojdbc}</version>
173
            </dependency>
174
175
            <!-- ipu jar -->
176
            <dependency>
177
                <groupId>com.ai.ipu</groupId>
178
                <artifactId>ipu-basic</artifactId>
179
                <version>${ipu}</version>
180
            </dependency>
181
            <dependency>
182
                <groupId>com.ai.ipu</groupId>
183
                <artifactId>ipu-common</artifactId>
184
                <version>${ipu}</version>
185
            </dependency>
186
            <dependency>
187
                <groupId>com.ai.ipu</groupId>
188
                <artifactId>ipu-database</artifactId>
189
                <version>${ipu}</version>
190
            </dependency>
191
            <dependency>
192
                <groupId>com.ai.ipu</groupId>
193
                <artifactId>ipu-remote-clinet</artifactId>
194
                <version>${ipu}</version>
195
            </dependency>
196
            <dependency>
197
                <groupId>com.ai.ipu</groupId>
198
                <artifactId>ipu-server-web</artifactId>
199
                <version>${ipu}</version>
200
            </dependency>
201
            <dependency>
202
                <groupId>com.ai.ipu</groupId>
203
                <artifactId>ipu-file-system</artifactId>
204
                <version>${ipu}</version>
205
            </dependency>
206
207
            <dependency>
208
                <!-- 不推荐使用,推荐使用wade-mobile-data -->
209
                <groupId>com.ai.wade</groupId>
210
                <artifactId>wade-data</artifactId>
211
                <version>${wade}</version>
212
            </dependency>
213
            <dependency>
214
                <!-- 不依赖其他jar -->
215
                <groupId>com.ai.wade</groupId>
216
                <artifactId>wade-mobile-data</artifactId>
217
                <version>${wade}</version>
218
            </dependency>
219
            <dependency>
220
                <!-- commons-collections-3.2.jar,quartz-all-1.6.3.jar,jdom1.0.jar,wade-apache,wade-common,wade-mobile-data -->
221
                <groupId>com.ai.wade</groupId>
222
                <artifactId>wade-cache</artifactId>
223
                <version>${wade}</version>
224
            </dependency>
225
            <dependency>
226
                <groupId>com.ai.wade</groupId>
227
                <artifactId>wade-apache</artifactId>
228
                <version>${wade}</version>
229
            </dependency>
230
            <dependency>
231
                <groupId>com.ai.wade</groupId>
232
                <artifactId>wade-common</artifactId>
233
                <version>${wade}</version>
234
            </dependency>
235
            <dependency>
236
                <!-- commons-dbcp-1.4.jar,dom4j-1.6.1.jar,jaxen-1.1.1.jar,jta.jar,ojdbc14.jar,mysql-connector-5.1.39.jar,wade-apache,wade-cache,wade-common,wade-mobile-data -->
237
                <groupId>com.ai.wade</groupId>
238
                <artifactId>wade-database</artifactId>
239
                <version>${wade}</version>
240
            </dependency>
241
            <dependency>
242
                <groupId>com.ai.wade</groupId>
243
                <artifactId>wade-sqlite-jdbc</artifactId>
244
                <version>${wade}</version>
245
            </dependency>
246
            <dependency>
247
                <!-- ipu-basic,ipu-server-web,wade-apache,wade-cache,wade-common,wade-database,wade-mobile-data -->
248
                <groupId>com.ai.wade</groupId>
249
                <artifactId>wade-codecode</artifactId>
250
                <version>${wade}</version>
251
            </dependency>
252
253
        </dependencies>
254
    </dependencyManagement>
255
    
256
	<artifactId>display-server</artifactId>
257
	<packaging>war</packaging>
258
	<name>展示平台</name>
259
	<description>3.0以后的展示平台工程全部支持Maven和Ant两种构建方式</description>
260
261
	<dependencies>
262
		<!-- 公共必选依赖 -->
263
		<!-- Central jar -->
264
		<dependency>
265
			<groupId>junit</groupId>
266
			<artifactId>junit</artifactId>
267
		</dependency>
268
		
269
		<dependency>
270
			<groupId>org.apache.commons</groupId>
271
			<artifactId>commons-lang3</artifactId>
272
		</dependency>
273
		<dependency>
274
			<groupId>log4j</groupId>
275
			<artifactId>log4j</artifactId>
276
		</dependency>
277
		<dependency>
278
			<groupId>dom4j</groupId>
279
			<artifactId>dom4j</artifactId>
280
		</dependency>
281
		<dependency>
282
			<groupId>jaxen</groupId>
283
			<artifactId>jaxen</artifactId>
284
		</dependency>
285
		<dependency>
286
			<groupId>com.mashape.unirest</groupId>
287
			<artifactId>unirest-java</artifactId>
288
		</dependency>
289
		<dependency>
290
			<groupId>org.beetl</groupId>
291
			<artifactId>beetl-core</artifactId>
292
		</dependency>
293
		<dependency>
294
			<groupId>org.apache.velocity</groupId>
295
			<artifactId>velocity</artifactId>
296
		</dependency>
297
		<!-- 3rd party jar -->
298
		<dependency>
299
			<groupId>com</groupId>
300
			<artifactId>java_memcache-release</artifactId>
301
		</dependency>
302
		<!-- ipu jar -->
303
		<dependency>
304
			<groupId>com.ai.ipu</groupId>
305
			<artifactId>ipu-basic</artifactId>
306
		</dependency>
307
		<dependency>
308
			<groupId>com.ai.ipu</groupId>
309
			<artifactId>ipu-common</artifactId>
310
		</dependency>
311
		<dependency>
312
			<groupId>com.ai.ipu</groupId>
313
			<artifactId>ipu-server-web</artifactId>
314
		</dependency>
315
		<dependency>
316
			<groupId>com.ai.ipu</groupId>
317
			<artifactId>ipu-file-system</artifactId>
318
		</dependency>
319
		<dependency>
320
			<groupId>com.ai.wade</groupId>
321
			<artifactId>wade-data</artifactId>
322
		</dependency>
323
		<dependency>
324
			<groupId>com.ai.wade</groupId>
325
			<artifactId>wade-cache</artifactId>
326
		</dependency>
327
		<dependency>
328
			<groupId>com.ai.wade</groupId>
329
			<artifactId>wade-database</artifactId>
330
		</dependency>
331
		<dependency>
332
			<groupId>com.ai.wade</groupId>
333
			<artifactId>wade-apache</artifactId>
334
		</dependency>
335
		<dependency>
336
			<groupId>com.ai.wade</groupId>
337
			<artifactId>wade-common</artifactId>
338
		</dependency>
339
		<dependency>
340
			<groupId>com.ai.wade</groupId>
341
			<artifactId>wade-sqlite-jdbc</artifactId>
342
		</dependency>
343
344
		<!-- 公共可选依赖 -->
345
		<dependency>
346
			<groupId>org.jsoup</groupId>
347
			<artifactId>jsoup</artifactId>
348
		</dependency>
349
		<dependency>
350
			<groupId>commons-dbcp</groupId>
351
			<artifactId>commons-dbcp</artifactId>
352
		</dependency>
353
		<dependency>
354
			<groupId>mysql</groupId>
355
			<artifactId>mysql-connector-java</artifactId>
356
		</dependency>
357
		<dependency>
358
			<groupId>commons-fileupload</groupId>
359
			<artifactId>commons-fileupload</artifactId>
360
		</dependency>
361
		<dependency>
362
			<groupId>commons-codec</groupId>
363
			<artifactId>commons-codec</artifactId>
364
		</dependency>
365
		<!-- 额外依赖 -->
366
		<!-- 缺省用tomcat容器 -->
367
        
368
        <dependency>  
369
            <groupId>org.springframework.boot</groupId>  
370
            <artifactId>spring-boot-starter-web</artifactId>  
371
        </dependency> 
372
        
373
        <!-- 使用jetty容器 -->
374
        <!-- 
375
        <dependency>
376
            <groupId>org.springframework.boot</groupId>
377
            <artifactId>spring-boot-starter-web</artifactId>
378
            <exclusions>
379
                <exclusion>
380
                    <groupId>org.springframework.boot</groupId>
381
                    <artifactId>spring-boot-starter-tomcat</artifactId>
382
                </exclusion>
383
            </exclusions>
384
        </dependency>
385
        <dependency>
386
            <groupId>org.springframework.boot</groupId>
387
            <artifactId>spring-boot-starter-jetty</artifactId>
388
        </dependency>
389
         -->
390
        <dependency>  
391
           <groupId>org.springframework.boot</groupId>  
392
           <artifactId>spring-boot-starter-tomcat</artifactId>  
393
            <scope>provided</scope>  
394
        </dependency>  
395
        
396
        <dependency>  
397
            <groupId>org.springframework.boot</groupId>  
398
            <artifactId>spring-boot-starter-test</artifactId>  
399
        </dependency>  
400
		
401
	</dependencies>
402
403
	<build>
404
	<pluginManagement>
405
            <plugins>
406
                <!-- 默认插件,不引入也可使用 -->
407
                <!-- 默认jre编译版本:1.6 -->
408
                <plugin>
409
                    <groupId>org.apache.maven.plugins</groupId>
410
                    <artifactId>maven-compiler-plugin</artifactId>
411
                    <version>${maven-compiler-plugin}</version>
412
                    <configuration>
413
                        <source>${compiler-version}</source>
414
                        <target>${compiler-version}</target>
415
                        <encoding>${encoding}</encoding>
416
                    </configuration>
417
                </plugin>
418
                <!-- war包去除servlet-api的jar包 -->
419
                <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> 
420
                    <version>${maven-war-plugin}</version> <configuration> servlet-api相关jar不打包,前面的scope=provided已解决 
421
                    <packagingExcludes> WEB-INF/lib/servlet-api*.jar </packagingExcludes> <webResources> 
422
                    <resource> <directory>${jar-path}</directory> <includes> <include>*.jar</include> 
423
                    </includes> <targetPath>WEB-INF/lib</targetPath> </resource> </webResources> 
424
                    </configuration> </plugin> -->
425
                <!-- 跳过单元测试 -->
426
                <plugin>
427
                    <groupId>org.apache.maven.plugins</groupId>
428
                    <artifactId>maven-surefire-plugin</artifactId>
429
                    <version>${maven-surefire-plugin}</version>
430
                    <configuration>
431
                        <!-- 跳过单元测试 -->
432
                        <skip>true</skip>
433
                    </configuration>
434
                </plugin>
435
                <!-- clean中间文件 -->
436
                <plugin>
437
                    <artifactId>maven-clean-plugin</artifactId>
438
                    <version>${maven-clean-plugin}</version>
439
                    <executions>
440
                        <execution>
441
                            <id>clean-all</id>
442
                            <phase>clean</phase>
443
                            <goals>
444
                                <goal>clean</goal>
445
                            </goals>
446
                            <configuration>
447
                                <filesets>
448
                                    <fileset>
449
                                        <directory>${basedir}/src/main/webapp/encrypt</directory>
450
                                        <includes>
451
                                            <include>**/*</include>
452
                                        </includes>
453
                                    </fileset>
454
                                    <fileset>
455
                                        <directory>${basedir}/src/main/webapp</directory>
456
                                        <includes>
457
                                            <include>res.version.properties</include>
458
                                        </includes>
459
                                    </fileset>
460
                                    <fileset>
461
                                        <directory>${basedir}/src/main/webapp/template/lua</directory>
462
                                        <includes>
463
                                            <include>**/*</include>
464
                                        </includes>
465
                                    </fileset>
466
                                </filesets>
467
                            </configuration>
468
                        </execution>
469
                        <!-- 打包之前clean掉明文配置文件 -->
470
                        <execution>
471
                            <id>clean-config</id>
472
                            <phase>prepare-package</phase><!-- 打包之前 -->
473
                            <goals>
474
                                <goal>clean</goal>
475
                            </goals>
476
                            <configuration>
477
                                <excludeDefaultDirectories>true</excludeDefaultDirectories>
478
                                <filesets>
479
                                    <fileset>
480
                                        <directory>${basedir}/src/main/webapp/template</directory>
481
                                        <includes>
482
                                            <include>server-config.xml</include>
483
                                            <include>server-data.xml</include>
484
                                            <include>server-page.xml</include>
485
                                        </includes>
486
                                    </fileset>
487
                                </filesets>
488
                            </configuration>
489
                        </execution>
490
                    </executions>
491
                </plugin>
492
                <!-- 复制资源 -->
493
                <plugin>
494
                    <artifactId>maven-resources-plugin</artifactId>
495
                    <version>${maven-resources-plugin}</version>
496
                    <configuration>
497
                        <encoding>${encoding}</encoding>
498
                    </configuration>
499
                    <executions>
500
                        <execution>
501
                            <id>copy-config</id>
502
                            <phase>process-resources</phase><!-- 编译之前处理文件 -->
503
                            <goals>
504
                                <goal>copy-resources</goal>
505
                            </goals>
506
                            <configuration>
507
                                <outputDirectory>${basedir}/src/main/webapp/template</outputDirectory>
508
                                <resources>
509
                                    <resource>
510
                                        <directory>${basedir}/src/main/resources</directory>
511
                                        <includes>
512
                                            <include>server-config.xml</include>
513
                                            <include>server-data.xml</include>
514
                                            <include>server-page.xml</include>
515
                                        </includes>
516
                                    </resource>
517
                                </resources>
518
                            </configuration>
519
                        </execution>
520
                        <execution>
521
                            <id>copy-lua</id>
522
                            <phase>process-resources</phase>
523
                            <goals>
524
                                <goal>copy-resources</goal>
525
                            </goals>
526
                            <configuration>
527
                                <outputDirectory>${basedir}/src/main/webapp/template/lua</outputDirectory>
528
                                <resources>
529
                                    <resource>
530
                                        <directory>${basedir}/src/main/resources/lua</directory>
531
                                    </resource>
532
                                </resources>
533
                            </configuration>
534
                        </execution>
535
                    </executions>
536
                </plugin>
537
                <!-- 生成文件版本号和文件加密 -->
538
                <plugin>
539
                    <groupId>org.codehaus.mojo</groupId>
540
                    <artifactId>exec-maven-plugin</artifactId>
541
                    <version>${exec-maven-plugin}</version>
542
                    <executions>
543
                        <execution>
544
                            <id>res-encrypt</id>
545
                            <phase>test</phase>
546
                            <goals>
547
                                <goal>java</goal>
548
                            </goals>
549
                            <configuration>
550
                                <classpathScope>compile</classpathScope>
551
                                <includeProjectDependencies>true</includeProjectDependencies>
552
                                <mainClass>com.ai.ipu.server.tool.FileEncryptToolMaven</mainClass>
553
                                <arguments>
554
                                    <argument>src/main/webapp/</argument>
555
                                    <argument>false</argument>
556
                                    <argument></argument>
557
                                </arguments>
558
                            </configuration>
559
                        </execution>
560
                        <execution>
561
                            <id>res-version</id>
562
                            <phase>prepare-package</phase>
563
                            <goals>
564
                                <goal>java</goal>
565
                            </goals>
566
                            <configuration>
567
                                <classpathScope>compile</classpathScope>
568
                                <includeProjectDependencies>true</includeProjectDependencies>
569
                                <mainClass>com.ai.ipu.server.tool.VersionToolMaven</mainClass>
570
                                <arguments>
571
                                    <argument>src/main/webapp/</argument>
572
                                    <argument>false</argument>
573
                                    <argument>upload|setup|.gitignore|.DS_Store</argument>
574
                                </arguments>
575
                            </configuration>
576
                        </execution>
577
                    </executions>
578
                </plugin>
579
                <plugin>
580
                    <groupId>org.apache.maven.plugins</groupId>
581
                    <artifactId>maven-dependency-plugin</artifactId>
582
                    <version>${maven-dependency-plugin}</version>
583
                    <executions>
584
                        <execution>
585
                            <id>copy-dep</id>
586
                            <phase>package</phase>
587
                            <goals>
588
                                <goal>copy-dependencies</goal>
589
                            </goals>
590
                            <configuration>
591
                                <outputDirectory>${basedir}/src/main/webapp/WEB-INF/lib</outputDirectory>
592
                                <excludeScope>provided</excludeScope>
593
                                <excludeArtifactIds>junit</excludeArtifactIds>
594
                            </configuration>
595
                        </execution>
596
                    </executions>
597
                </plugin>
598
            </plugins>
599
        </pluginManagement>
600
601
        <outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory>
602
		<plugins>                                                                 
603
			
604
			<plugin>  
605
                <groupId>org.springframework.boot</groupId>  
606
                <artifactId>spring-boot-maven-plugin</artifactId>  
607
                <version>1.2.1.RELEASE</version>
608
                <configuration>  
609
                <mainClass>com.ai.server.springboot.MainModule</mainClass>  
610
            </configuration>
611
                
612
            </plugin>
613
            <!-- 生成文件版本号和文件加密 -->
614
            <plugin>
615
                <groupId>org.codehaus.mojo</groupId>
616
                <artifactId>exec-maven-plugin</artifactId>
617
            </plugin>
618
		</plugins>
619
620
		<finalName>display</finalName>
621
	</build>
622
  
623
 
624
    <repositories>  
625
        <repository>  
626
            <id>spring-milestone</id>  
627
            <url>http://repo.spring.io/libs-release</url>  
628
        </repository>
629
        <repository>
630
        <id>nexus-service-ipu-repository</id>
631
			<name>nexus service ipu repository</name>
632
			<url>http://114.215.100.48:9090/nexus/content/repositories/ipu/</url>
633
        </repository>
634
    </repositories>
635
</project>

+ 22 - 0
display-server/src/main/java/com/ai/server/springboot/DefaultFilter.java

1
package com.ai.server.springboot;
2

3
import org.springframework.context.annotation.Configuration;
4
import org.springframework.core.Ordered;
5
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
6
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
7

8
@Configuration
9
public class DefaultFilter extends WebMvcConfigurerAdapter{
10
    @Override
11
    public void addViewControllers( ViewControllerRegistry registry ) {
12
        registry.addViewController( "/" ).setViewName( "forward:/mobile" );
13
        registry.setOrder( Ordered.HIGHEST_PRECEDENCE );
14
        
15
        super.addViewControllers( registry );
16
    } 
17
}
18

19
/*
20
public class DefaultFilter{
21
	
22
}*/

+ 85 - 0
display-server/src/main/java/com/ai/server/springboot/MainModule.java

1
package com.ai.server.springboot;
2

3
import org.springframework.boot.SpringApplication;
4
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5
import org.springframework.boot.autoconfigure.SpringBootApplication;
6
import org.springframework.boot.builder.SpringApplicationBuilder;
7
import org.springframework.boot.context.embedded.FilterRegistrationBean;
8
import org.springframework.boot.context.embedded.ServletListenerRegistrationBean;
9
import org.springframework.boot.context.embedded.ServletRegistrationBean;
10
import org.springframework.boot.context.web.SpringBootServletInitializer;
11
import org.springframework.context.annotation.Bean;
12
import org.springframework.web.bind.annotation.RequestMapping;
13
import org.springframework.web.bind.annotation.RestController;
14
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
15
import org.springframework.web.servlet.DispatcherServlet;
16

17
import com.ai.server.Hi;
18

19

20
@SpringBootApplication
21
public class MainModule {
22
	
23
//	@Bean
24
//    public ServletRegistrationBean servletRegistrationBean() {
25
//        return new ServletRegistrationBean(new Hi(), "/mobile/*", "/mobiledata/*");// ServletName默认值为首字母小写,即myServlet
26
//    }
27
	@Bean
28
	public ServletRegistrationBean getMobile(){
29
	  
30
	  //用ServletRegistrationBean包装servlet
31
	  ServletRegistrationBean registrationBean
32
	      = new ServletRegistrationBean(new com.ai.ipu.server.servlet.MobileUiServlet());
33
	  registrationBean.setLoadOnStartup(0);
34
	  //指定urlmapping
35
	  registrationBean.addUrlMappings("/mobile/*");
36
	  //指定name,如果不指定默认为dispatcherServlet
37
	  registrationBean.setName("mobile");
38
	  return registrationBean;
39
	}
40
	
41
	@Bean
42
	public ServletRegistrationBean getMobiledata(){
43
	  
44
	  //用ServletRegistrationBean包装servlet
45
	  ServletRegistrationBean registrationBean
46
	      = new ServletRegistrationBean(new com.ai.ipu.server.servlet.MobileDataServlet());
47
	  registrationBean.setLoadOnStartup(1);
48
	  //指定urlmapping
49
	  registrationBean.addUrlMappings("/mobiledata/*");
50
	  //指定name,如果不指定默认为dispatcherServlet
51
	  registrationBean.setName("mobiledata");
52
	  return registrationBean;
53
	}
54
	
55
	@Bean
56
    public FilterRegistrationBean indexFilterRegistration() {
57
		System.out.println("enter filter........");
58
        FilterRegistrationBean registration = new FilterRegistrationBean();
59
        //com.ai.ipu.server.servlet.MobileFilter filter = new com.ai.ipu.server.servlet.MobileFilter();
60
        com.ai.ipu.server.servlet.MobileFilter filter = new com.ai.ipu.server.servlet.MobileFilter();
61
        registration.setFilter(filter);
62
        registration.addUrlPatterns("/mobile");
63
        registration.addUrlPatterns("/mobiledata");
64
        System.out.println("filter dealing");
65
        return registration;
66
    }
67
    
68
	/*@Bean
69
    public ServletListenerRegistrationBean servletListenerRegistrationBean(){
70
        ServletListenerRegistrationBean servletListenerRegistrationBean = new ServletListenerRegistrationBean();
71
        servletListenerRegistrationBean.setListener(new IndexListener());
72
        return servletListenerRegistrationBean;
73
    }*/
74
    
75
	public static void main(String[] args) {
76
		// TODO Auto-generated method stub
77
		SpringApplication.run(MainModule.class, args);
78
	}
79

80
}
81

82
/*
83
public class MainModule {
84
	
85
}*/

+ 17 - 0
display-server/src/main/resources/application.properties

1
server.port=9084
2

3
SERVER_TYPE=embedded-tomcat
4

5
templateRoot=/home/aiosc/web/
6
#templateRoot=e:/temp/display/
7

8
spring.mvc.static-path-pattern=/**
9
spring.resources.static-locations=classpath:/static/,file:${templateRoot}
10

11
server.context-path=/display-server
12
#server.servlet-path=/display-server
13
spring.application.name=display-server
14
spring.application.index=display-server
15

16
#spring.view.prefix=/jsp/
17
#spring.view.suffix=.jsp

+ 3 - 0
display-server/src/main/resources/banner.txt

1
spring boot 开始跑起来了
2
${application.formatted-version}
3
${spring-boot.formatted-version}

+ 0 - 1
ipu-mobile-ui/pom.xml

5
		<groupId>com.ai.ipu.mobile</groupId>
5
		<groupId>com.ai.ipu.mobile</groupId>
6
		<artifactId>ipu-mobile-aggregator</artifactId>
6
		<artifactId>ipu-mobile-aggregator</artifactId>
7
		<version>3.0</version>
7
		<version>3.0</version>
8
		<relativePath>../ipu-mobile-aggregator/pom.xml</relativePath>
9
	</parent>
8
	</parent>
10
9
11
	<artifactId>ipu-mobile-ui</artifactId>
10
	<artifactId>ipu-mobile-ui</artifactId>

+ 1 - 1
ipu-plugin-basic/.classpath

1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
2
<classpath>
3
	<classpathentry combineaccessrules="false" kind="src" path="/ipu-plugin-extend"/>
4
	<classpathentry kind="src" output="target/classes" path="src/main/java">
3
	<classpathentry kind="src" output="target/classes" path="src/main/java">
5
		<attributes>
4
		<attributes>
6
			<attribute name="optional" value="true"/>
5
			<attribute name="optional" value="true"/>
18
			<attribute name="maven.pomderived" value="true"/>
17
			<attribute name="maven.pomderived" value="true"/>
19
		</attributes>
18
		</attributes>
20
	</classpathentry>
19
	</classpathentry>
20
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
21
	<classpathentry kind="output" path="target/classes"/>
21
	<classpathentry kind="output" path="target/classes"/>
22
</classpath>
22
</classpath>

+ 0 - 1
ipu-plugin-basic/pom.xml

5
		<groupId>com.ai.ipu.mobile</groupId>
5
		<groupId>com.ai.ipu.mobile</groupId>
6
		<artifactId>ipu-mobile-aggregator</artifactId>
6
		<artifactId>ipu-mobile-aggregator</artifactId>
7
		<version>3.0</version>
7
		<version>3.0</version>
8
		<relativePath>../ipu-mobile-aggregator/pom.xml</relativePath>
9
	</parent>
8
	</parent>
10
9
11
	<artifactId>ipu-plugin-basic</artifactId>
10
	<artifactId>ipu-plugin-basic</artifactId>