-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.xml
227 lines (109 loc) · 143 KB
/
search.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
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>HTML 特殊转义字符对照</title>
<link href="/2019/04/21/HTML-%E7%89%B9%E6%AE%8A%E8%BD%AC%E4%B9%89%E5%AD%97%E7%AC%A6%E5%AF%B9%E7%85%A7/"/>
<url>/2019/04/21/HTML-%E7%89%B9%E6%AE%8A%E8%BD%AC%E4%B9%89%E5%AD%97%E7%AC%A6%E5%AF%B9%E7%85%A7/</url>
<content type="html"><![CDATA[ <p style="text-align:center;"> <strong>HTML 特殊转义字符</strong> 对照表</p><table><thead><tr><th>字符</th><th>十进制</th><th>转义字符</th><th>字符</th><th>十进制</th><th>转义字符</th></tr></thead><tbody><tr><td><b> “ </b></td><td><code>&#34;</code></td><td><code>&quot;</code></td><td><b> ? </b></td><td><code>&#161;</code></td><td><code>&iexcl;</code></td></tr><tr><td><b> & </b></td><td><code>&#38;</code></td><td><code>&amp;</code></td><td><b> ¢ </b></td><td><code>&#162;</code></td><td><code>&cent;</code></td></tr><tr><td><b> > </b></td><td><code>&#60;</code></td><td><code>&lt;</code></td><td><b> £ </b></td><td><code>&#163;</code></td><td><code>&pound;</code></td></tr><tr><td><b> < </b></td><td><code>&#62;</code></td><td><code>&gt;</code></td><td><b> ¤ </b></td><td><code>&#164;</code></td><td><code>&curren;</code></td></tr><tr><td>不断开空格<br>(non-breaking space)</td><td><code>&#160;</code></td><td><code>&nbsp;</code></td><td><b> ¥ </b></td><td><code>&#165;</code></td><td><code>&yen;</code></td></tr><tr><td><b> ¦ </b></td><td><code>&#166;</code></td><td><code>&brvbar;</code></td><td><b> § </b></td><td><code>&#167;</code></td><td><code>&sect;</code> </td></tr><tr><td><b> ¨ </b></td><td><code>&#168;</code></td><td><code>&uml;</code></td><td><b> × </b></td><td><code>&#215;</code></td><td><code>&times;</code> </td></tr><tr><td><b> © </b></td><td><code>&#169;</code></td><td><code>&copy;</code></td><td><b> a </b></td><td><code>&#170;</code></td><td><code>&ordf;</code></td></tr><tr><td><b> ? </b></td><td><code>&#171;</code></td><td><code>&laquo;</code></td><td><b> ? </b></td><td><code>&#172;</code></td><td><code>&not;</code></td></tr><tr><td><b> ǵ </b></td><td><code>&#501;</code></td><td><code>&gacute;</code></td><td><b> ® </b></td><td><code>&#174;</code></td><td><code>&reg;</code></td></tr><tr><td><b> ˉ </b></td><td><code>&#175;</code></td><td><code>&macr;</code></td><td><b> ° </b></td><td><code>&#176;</code></td><td><code>&deg;</code></td></tr><tr><td><b> ± </b></td><td><code>&#177;</code></td><td><code>&plusmn;</code></td><td><b> 2 </b></td><td><code>&#178;</code></td><td><code>&sup2;</code></td></tr><tr><td><b> 3 </b></td><td><code>&#179;</code></td><td><code>&sup3;</code></td><td><b> ′ </b></td><td><code>&#180;</code></td><td><code>&acute;</code></td></tr><tr><td><b> μ </b></td><td><code>&#181;</code></td><td><code>&micro;</code></td><td><b> ? </b></td><td><code>&#182;</code></td><td><code>&para;</code></td></tr><tr><td><b> · </b></td><td><code>&#183;</code></td><td><code>&middot;</code></td><td><b> ? </b></td><td><code>&#184;</code></td><td><code>&cedil;</code></td></tr><tr><td><b> 1 </b></td><td><code>&#185;</code></td><td><code>&sup1;</code></td><td><b> o </b></td><td><code>&#186;</code></td><td><code>&ordm;</code></td></tr><tr><td><b> ? </b></td><td><code>&#187;</code></td><td><code>&raquo;</code></td><td><b> ? </b></td><td><code>&#188;</code></td><td><code>&frac14;</code></td></tr><tr><td><b> ? </b></td><td><code>&#189;</code></td><td><code>&frac12;</code></td><td><b> ? </b></td><td><code>&#190;</code></td><td><code>&frac34;</code></td></tr><tr><td><b> ? </b></td><td><code>&#191;</code></td><td><code>&iquest;</code></td><td><b> À </b></td><td><code>&#192;</code></td><td><code>&Agrave;</code></td></tr><tr><td><b> Á </b></td><td><code>&#193;</code></td><td><code>&Aacute;</code></td><td><b> Â </b></td><td><code>&#194;</code></td><td><code>&circ;</code></td></tr><tr><td><b> Ã </b></td><td><code>&#195;</code></td><td><code>&Atilde;</code></td><td><b> Ä </b></td><td><code>&#196;</code></td><td><code>&Auml</code></td></tr><tr><td><b> Å </b></td><td><code>&#197;</code></td><td><code>&ring;</code></td><td><b> Æ </b></td><td><code>&#198;</code></td><td><code>&AElig;</code></td></tr><tr><td><b> Ç </b></td><td><code>&#199;</code></td><td><code>&Ccedil;</code></td><td><b> È </b></td><td><code>&#200;</code></td><td><code>&Egrave;</code></td></tr><tr><td><b> É </b></td><td><code>&#201;</code></td><td><code>&Eacute;</code></td><td><b> Ê </b></td><td><code>&#202;</code></td><td><code>&Ecirc;</code></td></tr><tr><td><b> Ë </b></td><td><code>&#203;</code></td><td><code>&Euml;</code></td><td><b> Ì </b></td><td><code>&#204;</code></td><td><code>&Igrave;</code></td></tr><tr><td><b> Í </b></td><td><code>&#205;</code></td><td><code>&Iacute;</code></td><td><b> Î </b></td><td><code>&#206;</code></td><td><code>&Icirc;</code></td></tr><tr><td><b> Ï </b></td><td><code>&#207;</code></td><td><code>&Iuml;</code></td><td><b> Ð </b></td><td><code>&#208;</code></td><td><code>&ETH;</code></td></tr><tr><td><b> Ñ </b></td><td><code>&#209;</code></td><td><code>&Ntilde;</code></td><td><b> Ò </b></td><td><code>&#210;</code></td><td><code>&Ograve;</code></td></tr><tr><td><b> Ó </b></td><td><code>&#211;</code></td><td><code>&Oacute;</code></td><td><b> Ô </b></td><td><code>&#212;</code></td><td><code>&Ocirc;</code></td></tr><tr><td><b> Õ </b></td><td><code>&#213;</code></td><td><code>&Otilde;</code></td><td><b> Ö </b></td><td><code>&#214;</code></td><td><code>&Ouml;</code></td></tr><tr><td><b> Ø </b></td><td><code>&#216;</code></td><td><code>&Oslash;</code></td><td><b> ÿ </b></td><td><code>&#255;</code></td><td><code>&yuml;</code></td></tr><tr><td><b> Ù </b></td><td><code>&#217;</code></td><td><code>&Ugrave;</code></td><td><b> Ú </b></td><td><code>&#218;</code></td><td><code>&Uacute;</code></td></tr><tr><td><b> Û </b></td><td><code>&#219;</code></td><td><code>&Ucirc;</code></td><td><b> Ü </b></td><td><code>&#220;</code></td><td><code>&Uuml;</code></td></tr><tr><td><b> Ý </b></td><td><code>&#221;</code></td><td><code>&Yacute;</code></td><td><b> Þ </b></td><td><code>&#222;</code></td><td><code>&THORN;</code></td></tr><tr><td><b> ß </b></td><td><code>&#223;</code></td><td><code>&szlig;</code></td><td><b> à </b></td><td><code>&#224;</code></td><td><code>&agrave;</code></td></tr><tr><td><b> á </b></td><td><code>&#225;</code></td><td><code>&aacute;</code></td><td><b> â </b></td><td><code>&#226</code></td><td><code>&acirc;</code></td></tr><tr><td><b> ã </b></td><td><code>&#227;</code></td><td><code>&atilde;</code></td><td><b> ä </b></td><td><code>&#228;</code></td><td><code>&auml;</code></td></tr><tr><td><b> å </b></td><td><code>&#229;</code></td><td><code>&aring;</code></td><td><b> æ </b></td><td><code>&#230;</code></td><td><code>&aelig;</code></td></tr><tr><td><b> ç </b></td><td><code>&#231;</code></td><td><code>&ccedil;</code></td><td><b> è </b></td><td><code>&#232;</code></td><td><code>&egrave;</code></td></tr><tr><td><b> é </b></td><td><code>&#233;</code></td><td><code>&eacute;</code></td><td><b> ê </b></td><td><code>&#234;</code></td><td><code>&ecirc;</code></td></tr><tr><td><b> ë </b></td><td><code>&#235;</code></td><td><code>&euml;</code></td><td><b> ì </b></td><td><code>&#236;</code></td><td><code>&igrave;</code></td></tr><tr><td><b> í </b></td><td><code>&#237;</code></td><td><code>&iacute;</code></td><td><b> î </b></td><td><code>&#238;</code></td><td><code>&icirc;</code></td></tr><tr><td><b> ï </b></td><td><code>&#239;</code></td><td><code>&iuml;</code></td><td><b> ð </b></td><td><code>&#240;</code></td><td><code>&ieth;</code></td></tr><tr><td><b> ñ </b></td><td><code>&#241;</code></td><td><code>&ntilde;</code></td><td><b> ò </b></td><td><code>&#242;</code></td><td><code>&ograve;</code></td></tr><tr><td><b> ó </b></td><td><code>&#243;</code></td><td><code>&oacute;</code></td><td><b> ô </b></td><td><code>&#244;</code></td><td><code>&ocirc;</code></td></tr><tr><td><b> õ </b></td><td><code>&#245;</code></td><td><code>&otilde;</code></td><td><b> ö </b></td><td><code>&#246;</code></td><td><code>&ouml;</code></td></tr><tr><td><b> ÷ </b></td><td><code>&#247;</code></td><td><code>&divide;</code></td><td><b> ø </b></td><td><code>&#248;</code></td><td><code>&oslash;</code></td></tr><tr><td><b> ù </b></td><td><code>&#249;</code></td><td><code>&ugrave;</code></td><td><b> ú </b></td><td><code>&#250;</code></td><td><code>&uacute;</code></td></tr><tr><td><b> û </b></td><td><code>&#251;</code></td><td><code>&ucirc;</code></td><td><b> ü </b></td><td><code>&#252;</code></td><td><code>&uuml;</code></td></tr><tr><td><b> ý </b></td><td><code>&#253;</code></td><td><code>&yacute;</code></td><td><b> þ </b></td><td><code>&#254;</code></td><td><code>&thorn;</code></td></tr></tbody></table>]]></content>
<categories>
<category> HTML </category>
<category> WEB </category>
</categories>
<tags>
<tag> HTML </tag>
</tags>
</entry>
<entry>
<title>自定义Maven脚手架之archetype</title>
<link href="/2019/04/17/%E8%87%AA%E5%AE%9A%E4%B9%89Maven%E8%84%9A%E6%89%8B%E6%9E%B6%E4%B9%8Barchetype/"/>
<url>/2019/04/17/%E8%87%AA%E5%AE%9A%E4%B9%89Maven%E8%84%9A%E6%89%8B%E6%9E%B6%E4%B9%8Barchetype/</url>
<content type="html"><![CDATA[<p><strong>前言:</strong><br> Maven是一个优秀且被广泛应用的代码构建工具,采用<strong>[约定优先于配置]</strong>的原则进行项目管理,在使用Maven创建项目的时候,我们往往会使用Maven内置的项目骨架<code>(即:archetype)</code>来快速生成项目结构;archetype是在maven-archetype-plugin插件执行generate目标的时候进行配置的,我们经常使用到Maven的预置的骨架包括:maven-archetype-webapp、maven-archetype-quickstart等;前者用来快速搭建一个web工程项目,后者用来快速搭建一个普通的java工程项目。<br> 但是在团队开发的过程中,Maven预置的archetypes可能是并不能很好的满足开发需求,因为不同的业务和开发团队在项目结构上都会有定制化的需求;在这样的背景下我们有必要去定义一个足够 <strong>定制的</strong> 代码骨架供团队使用,如此一来,团队在往后的开发中就可以利用自定义的Maven骨架一键生成项目结构。</p><h2 id="我们来按照官方文档来创建一个自己的单模块脚手架-archetype"><a href="#我们来按照官方文档来创建一个自己的单模块脚手架-archetype" class="headerlink" title="我们来按照官方文档来创建一个自己的单模块脚手架(archetype)"></a>我们来按照官方文档来创建一个自己的单模块脚手架(archetype)</h2><p> <em>官方文档地址</em>: <a href="http://maven.apache.org/guides/mini/guide-creating-archetypes.html" target="_blank" rel="noopener">http://maven.apache.org/guides/mini/guide-creating-archetypes.html</a></p><h3 id="创建archetype项目结构"><a href="#创建archetype项目结构" class="headerlink" title="创建archetype项目结构"></a>创建archetype项目结构</h3><h4 id="1-我的archetype结构"><a href="#1-我的archetype结构" class="headerlink" title="1.我的archetype结构:"></a>1.我的archetype结构:</h4><p><img src="/imgs/2/2019-04-17_220410.png" alt="图A.archetype目录结构"><br> <strong>src/main/resources</strong> 这个是Maven规定的目录结构,只是不再有 src/main/java 或者 src/test , 所有和骨架模板相关的配置,都是写在 <strong>src/main/resources</strong>目录下<br>即:按照这个骨架创建出来的项目,默认是如下图B结构,和上图A中<strong>src/main/resources/archetype-resources</strong> 下面的结构一致:<br><img src="/imgs/2/2019-04-17_221039.png" alt="图B.骨架生成项目默认目录结构"></p><h4 id="2-按照需求配置archetype项目"><a href="#2-按照需求配置archetype项目" class="headerlink" title="2.按照需求配置archetype项目"></a>2.按照需求配置archetype项目</h4><p>要按照配置并发布骨架,主要是配置这几个部分:</p><ol><li>主目录下的pom.xml文件</li><li>src/main/resources/archetype-resources //下面的目录和文件就是真正想要使用骨架创建的项目的结构,根据需求进行布置</li><li>在src/main/resources/META-INF/maven/archetype-metadata.xml //配置相关的元数据描述信息,即告知骨架如何编译</li></ol><h5 id="1-主目录下的pom-xml"><a href="#1-主目录下的pom-xml" class="headerlink" title="1)主目录下的pom.xml"></a>1)主目录下的pom.xml</h5><pre class=" language-xml"><code class="language-xml"><span class="token prolog"><?xml version="1.0" encoding="UTF-8"?></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>project</span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://maven.apache.org/POM/4.0.0<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xmlns:</span>xsi</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://www.w3.org/2001/XMLSchema-instance<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xsi:</span>schemaLocation</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>modelVersion</span><span class="token punctuation">></span></span>4.0.0<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>modelVersion</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 定义自己的脚手架元信息 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>com.fh.archetypes<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>fh-framework-archetype<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>version</span><span class="token punctuation">></span></span>1.0.0-SNAPSHOT<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>version</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>packaging</span><span class="token punctuation">></span></span>jar<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>packaging</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>name</span><span class="token punctuation">></span></span>FhFrameworkArchetype<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>name</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 设置发布脚手架的Maven仓库地址 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>distributionManagement</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>repository</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>id</span><span class="token punctuation">></span></span>releases<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>id</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>name</span><span class="token punctuation">></span></span>FH Release Repository<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>name</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>url</span><span class="token punctuation">></span></span>http://***/nexus/content/repositories/releases/<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>url</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>repository</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>snapshotRepository</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>id</span><span class="token punctuation">></span></span>snapshots<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>id</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>name</span><span class="token punctuation">></span></span>FH Snapshot Repository<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>name</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>url</span><span class="token punctuation">></span></span>http://***/nexus/content/repositories/snapshots/<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>url</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>snapshotRepository</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>distributionManagement</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 作者及机构信息 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>developers</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>developer</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>id</span><span class="token punctuation">></span></span>flyTiger<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>id</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>name</span><span class="token punctuation">></span></span>LFH<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>name</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>email</span><span class="token punctuation">></span></span>xxx.com.cn<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>email</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>url</span><span class="token punctuation">></span></span>http://www.fh.com<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>url</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>organization</span><span class="token punctuation">></span></span>FH<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>organization</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>roles</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>role</span><span class="token punctuation">></span></span>user<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>role</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>role</span><span class="token punctuation">></span></span>developer<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>role</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>roles</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>timezone</span><span class="token punctuation">></span></span>-6<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>timezone</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>developer</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>developers</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>project</span><span class="token punctuation">></span></span></code></pre><h5 id="2-src-main-resources-META-INF-maven-archetype-metadata-xml"><a href="#2-src-main-resources-META-INF-maven-archetype-metadata-xml" class="headerlink" title="2)src\main\resources\META-INF\maven\archetype-metadata.xml"></a>2)src\main\resources\META-INF\maven\archetype-metadata.xml</h5><pre class=" language-xml"><code class="language-xml"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>archetype-descriptor</span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xmlns:</span>xsi</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://www.w3.org/2001/XMLSchema-instance<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xsi:</span>schemaLocation</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>FH-Utils-archetype<span class="token punctuation">"</span></span> <span class="token attr-name">partial</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>FH-Utils-archetype<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 创建项目时的参数 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>requiredProperties</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>requiredProperty</span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>groupId<span class="token punctuation">"</span></span> <span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 默认值 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>defaultValue</span><span class="token punctuation">></span></span>com.fh<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>defaultValue</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>requiredProperty</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>requiredProperty</span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>artifactId<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>requiredProperty</span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>version<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>defaultValue</span><span class="token punctuation">></span></span>1.0.0<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>defaultValue</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>requiredProperty</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>requiredProperty</span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>appName<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>defaultValue</span><span class="token punctuation">></span></span>FH<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>defaultValue</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>requiredProperty</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>requiredProperties</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 骨架要编译的目录 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSets</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSet</span> <span class="token attr-name">filtered</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token attr-name">packaged</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token attr-name">encoding</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>directory</span><span class="token punctuation">></span></span>src/main/java<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>directory</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>**/*.java<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSet</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 不进行模板解析,因为有程序中默认包含的模板文件此时不能进行解析操作 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSet</span> <span class="token attr-name">filtered</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>false<span class="token punctuation">"</span></span> <span class="token attr-name">encoding</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>directory</span><span class="token punctuation">></span></span>src/main/resources<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>directory</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>**/*.*<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSet</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSet</span> <span class="token attr-name">filtered</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token attr-name">encoding</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>directory</span><span class="token punctuation">></span></span>src/main/webapp/WEB-INF<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>directory</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>*.*<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSet</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 这几个目录不进行模板解析 (静态资源或程序中其它模板)--></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSet</span> <span class="token attr-name">filtered</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>false<span class="token punctuation">"</span></span> <span class="token attr-name">encoding</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>directory</span><span class="token punctuation">></span></span>src/main/webapp<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>directory</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>ftl/**/*.*<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>html/**/*.*<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>static/**/*.*<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSet</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSet</span> <span class="token attr-name">filtered</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token attr-name">packaged</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token attr-name">encoding</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>directory</span><span class="token punctuation">></span></span>src/test/java<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>directory</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>**/*.java<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSet</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fileSet</span> <span class="token attr-name">filtered</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>false<span class="token punctuation">"</span></span> <span class="token attr-name">encoding</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>UTF-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>directory</span><span class="token punctuation">></span></span>src/test/resources<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>directory</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>include</span><span class="token punctuation">></span></span>**/*.*<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>include</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>includes</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSet</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fileSets</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>archetype-descriptor</span><span class="token punctuation">></span></span></code></pre><h5 id="3-src-main-resources-archetype-resources-pom-xml"><a href="#3-src-main-resources-archetype-resources-pom-xml" class="headerlink" title="3)src\main\resources\archetype-resources\pom.xml"></a>3)src\main\resources\archetype-resources\pom.xml</h5><pre class=" language-xml"><code class="language-xml"><span class="token prolog"><?xml version="1.0" encoding="UTF-8"?></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>project</span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://maven.apache.org/POM/4.0.0<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xmlns:</span>xsi</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://www.w3.org/2001/XMLSchema-instance<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xsi:</span>schemaLocation</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>modelVersion</span><span class="token punctuation">></span></span>4.0.0<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>modelVersion</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 这里就是标准Maven项目中pom.xml的配置了 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>parent</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>com.fh<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>fh-parent<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>version</span><span class="token punctuation">></span></span>0.0.1-SNAPSHOT<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>version</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>parent</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 这里会从创建项目中配置的参数中读取 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>${artifactId}<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>packaging</span><span class="token punctuation">></span></span>war<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>packaging</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>name</span><span class="token punctuation">></span></span>${artifactId}<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>name</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>url</span><span class="token punctuation">></span></span>http://www.fh.com/<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>url</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- 引入项目中必然要引入的依赖项 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>dependencies</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>dependency</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>-<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>-<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>version</span><span class="token punctuation">></span></span>-<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>version</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>dependency</span><span class="token punctuation">></span></span> <span class="token comment" spellcheck="true"><!-- ... --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>dependencies</span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- 项目构建插件配置 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>build</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>finalName</span><span class="token punctuation">></span></span>/${artifactId}<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>finalName</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>plugins</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>org.apache.maven.plugins<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>maven-compiler-plugin<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>org.apache.maven.plugins<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>maven-source-plugin<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>com.mysema.maven<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>apt-maven-plugin<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>org.apache.maven.plugins<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>maven-war-plugin<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>configuration</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>attachClasses</span><span class="token punctuation">></span></span>true<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>attachClasses</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>classesClassifier</span><span class="token punctuation">></span></span>api<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>classesClassifier</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>configuration</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>plugin</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>plugins</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>build</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>project</span><span class="token punctuation">></span></span></code></pre><h5 id="4-小TIP"><a href="#4-小TIP" class="headerlink" title="4) 小TIP"></a>4) 小TIP</h5><p> 在src/main/java这个目录下的java文件中的<strong>package</strong>可以引用<strong>${package}</strong>变量 如:<br> <img src="/imgs/2/2019-04-17_224736.png" alt></p><h3 id="安装并发布自定义的脚手架"><a href="#安装并发布自定义的脚手架" class="headerlink" title="安装并发布自定义的脚手架"></a>安装并发布自定义的脚手架</h3><p> 使用<code>mvn clean install</code>将脚手架安装到本地仓库,或者 <code>mvn depoly</code> 命令打包发布脚手架到远程仓库<br>现在就可以愉快的使用自已的脚手架来快速创建符合团队需求的项目结构了</p><blockquote><p><em>官方文档地址</em>: <a href="http://maven.apache.org/guides/mini/guide-creating-archetypes.html" target="_blank" rel="noopener">http://maven.apache.org/guides/mini/guide-creating-archetypes.html</a></p></blockquote>]]></content>
<categories>
<category> MAVEN </category>
<category> NOTES </category>
</categories>
<tags>
<tag> MAVEN </tag>
</tags>
</entry>
<entry>
<title>Maven 私库的搭建</title>
<link href="/2019/04/16/Maven-%E7%A7%81%E5%BA%93%E7%9A%84%E6%90%AD%E5%BB%BA/"/>
<url>/2019/04/16/Maven-%E7%A7%81%E5%BA%93%E7%9A%84%E6%90%AD%E5%BB%BA/</url>
<content type="html"><![CDATA[<p> <strong>前言:</strong> Maven私服(即Repository Manager)的主要作用:</p><ul><li>方便内部人员发布内部使用的依赖;</li><li>方便存放官方仓库中没有的第三方依赖包;</li><li>减少从中央仓库下载的次数,节省带宽、提高maven build的效率;</li><li>减少对中央仓库的依赖,确保maven build的稳定性;</li></ul><h2 id="这里主要记录在windows系统中搭建私库的简单过程"><a href="#这里主要记录在windows系统中搭建私库的简单过程" class="headerlink" title="这里主要记录在windows系统中搭建私库的简单过程"></a>这里主要记录在windows系统中搭建私库的简单过程</h2><p> <strong>首先:</strong> 去官网下载最新免费开源版<a href="https://www.sonatype.com/nexus-repository-oss" target="_blank" rel="noopener">nexus</a>, 下载对应电脑系统的压缩包.如: <img src="/imgs/1/maven1.png" alt><br><code>解压后在 nexus-3.10.0-04 文件夹目录</code><br><img src="/imgs/1/maven2.png" alt><br><code>两个主要文件目录:</code> <strong>bin</strong>,<strong>etc</strong><br><code>etc 文件中有相关的配置文件.nexus-default.properties 文件中可以配置端口号和默认进入 IP</code><br><img src="/imgs/1/maven3.png" alt><br>启动程序:(<strong>小TIP</strong>)在bin目录下新建一个bat文件,其中写 cmd 即可,此为方便在打开cmd窗口时定位到此文件夹;<br><img src="/imgs/1/maven4.png" alt><br>右键此bat文件,以管理员运行.在进入cmd窗口后,执行下面指令:</p><blockquote><p><strong>nexus.exe/install Nexus Service</strong></p></blockquote><p>执行此指令后在 系统服务中会看到:<br><img src="/imgs/1/maven5.png" alt><br><strong>Nexus Service</strong> 服务,启动此服务,等一会之后在浏览器窗口中输入:<br><strong>localhost:8091</strong> (此处端口号为自定义的,默认为8081)</p><p>然后就可以进入nexus 仓库.<br>仓库默认有两个帐号:<br>Nexus中预留了两个登陆账户,一个是<code>admin</code>,一个是<code>anonymous</code>。<br>admin具有全部权限默认密码<code>admin123</code>;anonymous作为匿名用户,只具有查看权限</p><p>几个库的说明:</p><ul><li><strong>maven-central</strong>:maven中央库,默认从 <a href="https://repo1.maven.org/maven2/" target="_blank" rel="noopener">https://repo1.maven.org/maven2/</a> 拉取jar </li><li><strong>maven-releases</strong>:私库发行版jar </li><li><strong>maven-snapshots</strong>:私库快照(调试版本)jar </li><li><strong>maven-public</strong>:仓库分组,把上面三个仓库组合在一起对外提供服务,在本地maven基础配置settings.xml中使用</li></ul><blockquote><p><a href="https://guides.sonatype.com/repo3/quick-start-guides/proxying-maven-and-npm/" target="_blank" rel="noopener">搭建私库教程及安装包下载</a></p></blockquote>]]></content>
<categories>
<category> NOTES </category>
<category> MAVEN </category>
</categories>
<tags>
<tag> MAVEN </tag>
</tags>
</entry>
<entry>
<title>JavaWeb项目在启动时执行特定操作</title>
<link href="/2019/04/15/JavaWeb%E9%A1%B9%E7%9B%AE%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E6%89%A7%E8%A1%8C%E7%89%B9%E5%AE%9A%E6%93%8D%E4%BD%9C/"/>
<url>/2019/04/15/JavaWeb%E9%A1%B9%E7%9B%AE%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E6%89%A7%E8%A1%8C%E7%89%B9%E5%AE%9A%E6%93%8D%E4%BD%9C/</url>
<content type="html"><![CDATA[<h1 id="如何让springmvc在启动的时候执行特定的业务处理"><a href="#如何让springmvc在启动的时候执行特定的业务处理" class="headerlink" title="如何让springmvc在启动的时候执行特定的业务处理?"></a>如何让springmvc在启动的时候执行特定的业务处理?</h1><p><strong>前言:</strong> java 的 web服务器启动时,经常会做一些特定的业务逻辑处理,比如数据库初始化,初始化系统参数,读取配置文库等.</p><h2 id="实现方法"><a href="#实现方法" class="headerlink" title="实现方法"></a>实现方法</h2><h3 id="一-Web项目,Servlet非Spring"><a href="#一-Web项目,Servlet非Spring" class="headerlink" title="一.Web项目,Servlet非Spring"></a>一.Web项目,Servlet非Spring</h3><p><strong>解决方案:</strong> 实现(ServletContextListener) 接口</p><h4 id="1-定义类实现ServletContextListener接口-并定义自己要执行的业务逻辑"><a href="#1-定义类实现ServletContextListener接口-并定义自己要执行的业务逻辑" class="headerlink" title="1.定义类实现ServletContextListener接口,并定义自己要执行的业务逻辑"></a>1.定义类实现ServletContextListener接口,并定义自己要执行的业务逻辑</h4><pre class=" language-java"><code class="language-java"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">StartInit</span> <span class="token keyword">implements</span> <span class="token class-name">ServletContextListener</span> <span class="token punctuation">{</span> <span class="token keyword">static</span> <span class="token keyword">final</span> Logger logger <span class="token operator">=</span> LoggerFactory<span class="token punctuation">.</span><span class="token function">getLogger</span><span class="token punctuation">(</span>StartInit<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 系统初始化执行方法 </span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">contextDestroyed</span><span class="token punctuation">(</span>ServletContextEvent e<span class="token punctuation">)</span> <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"系统停止..."</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">contextInitialized</span><span class="token punctuation">(</span>ServletContextEvent e<span class="token punctuation">)</span> <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"系统初始化开始..."</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 获取项目根目录 </span> String root_path <span class="token operator">=</span> e<span class="token punctuation">.</span><span class="token function">getServletContext</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getRealPath</span><span class="token punctuation">(</span><span class="token string">"/"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"application path : {}"</span><span class="token punctuation">,</span>root_path<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 初始化 ConfigFactorty </span> ConfigFactory<span class="token punctuation">.</span><span class="token function">init</span><span class="token punctuation">(</span>root_path<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 初始化数据链接信息 </span> DBManager<span class="token punctuation">.</span><span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 初始化定时统计任务 </span> TaskManager<span class="token punctuation">.</span><span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 初始化用户信息查询位置 </span> UserInfo<span class="token punctuation">.</span><span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// ... </span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"系统初始化结束..."</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre><h4 id="2-将实现了ServletContextListener接口的类配置为-web-xml-listener"><a href="#2-将实现了ServletContextListener接口的类配置为-web-xml-listener" class="headerlink" title="2.将实现了ServletContextListener接口的类配置为( web.xml) listener"></a>2.将实现了ServletContextListener接口的类配置为( web.xml) listener</h4><pre class=" language-xml"><code class="language-xml"><span class="token prolog"><?xml version="1.0" encoding="UTF-8"?></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>web-app</span> <span class="token attr-name">version</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>3.0<span class="token punctuation">"</span></span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://java.sun.com/xml/ns/javaee<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xmlns:</span>xsi</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://www.w3.org/2001/XMLSchema-instance<span class="token punctuation">"</span></span> <span class="token attr-name"><span class="token namespace">xsi:</span>schemaLocation</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>display-name</span><span class="token punctuation">></span></span>JMD Project<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>display-name</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>welcome-file-list</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>welcome-file</span><span class="token punctuation">></span></span>index.jsp<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>welcome-file</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>welcome-file-list</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>listener</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>listener-class</span><span class="token punctuation">></span></span>com.jmd.web.init.StartInit<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>listener-class</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>listener</span><span class="token punctuation">></span></span> ... <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>web-app</span><span class="token punctuation">></span></span></code></pre><h3 id="二-Web项目-使用Spring框架"><a href="#二-Web项目-使用Spring框架" class="headerlink" title="二.Web项目,使用Spring框架"></a>二.Web项目,使用Spring框架</h3><p><strong>解决方案:</strong> Spring-MVC的应用中,要实现类似的功能,主要是通过实现下面这些接口(任选一,至少一个即可)</p><h4 id="1-ApplicationContextAware接口"><a href="#1-ApplicationContextAware接口" class="headerlink" title="1.ApplicationContextAware接口"></a>1.ApplicationContextAware接口</h4><pre class=" language-java"><code class="language-java"> <span class="token keyword">package</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">;</span> <span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>BeansException<span class="token punctuation">;</span> <span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>Aware<span class="token punctuation">;</span> <span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>ApplicationContext<span class="token punctuation">;</span> <span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">ApplicationContextAware</span> <span class="token keyword">extends</span> <span class="token class-name">Aware</span> <span class="token punctuation">{</span> <span class="token keyword">void</span> <span class="token function">setApplicationContext</span><span class="token punctuation">(</span>ApplicationContext var1<span class="token punctuation">)</span> <span class="token keyword">throws</span> BeansException<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre><h4 id="2-ServletContextAware-接口"><a href="#2-ServletContextAware-接口" class="headerlink" title="2.ServletContextAware 接口"></a>2.ServletContextAware 接口</h4><pre class=" language-java"><code class="language-java"> <span class="token keyword">package</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>context<span class="token punctuation">;</span> <span class="token keyword">import</span> javax<span class="token punctuation">.</span>servlet<span class="token punctuation">.</span>ServletContext<span class="token punctuation">;</span> <span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>Aware<span class="token punctuation">;</span> <span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">ServletContextAware</span> <span class="token keyword">extends</span> <span class="token class-name">Aware</span> <span class="token punctuation">{</span> <span class="token keyword">void</span> <span class="token function">setServletContext</span><span class="token punctuation">(</span>ServletContext var1<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre><h4 id="3-InitializingBean-接口"><a href="#3-InitializingBean-接口" class="headerlink" title="3.InitializingBean 接口"></a>3.InitializingBean 接口</h4><pre class=" language-java"><code class="language-java"> <span class="token keyword">package</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">;</span> <span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">InitializingBean</span> <span class="token punctuation">{</span> <span class="token keyword">void</span> <span class="token function">afterPropertiesSet</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> Exception<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre><h4 id="4-ApplicationListener-接口"><a href="#4-ApplicationListener-接口" class="headerlink" title="4.ApplicationListener 接口"></a>4.ApplicationListener<applicationevent> 接口</applicationevent></h4><pre class=" language-java"><code class="language-java"> <span class="token keyword">package</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">;</span> <span class="token keyword">import</span> java<span class="token punctuation">.</span>util<span class="token punctuation">.</span>EventListener<span class="token punctuation">;</span> <span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>ApplicationEvent<span class="token punctuation">;</span> <span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">ApplicationListener</span><span class="token operator"><</span>E <span class="token keyword">extends</span> <span class="token class-name">ApplicationEvent</span><span class="token operator">></span> <span class="token keyword">extends</span> <span class="token class-name">EventListener</span> <span class="token punctuation">{</span> <span class="token keyword">void</span> <span class="token function">onApplicationEvent</span><span class="token punctuation">(</span>E var1<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre><h4 id="示例代码"><a href="#示例代码" class="headerlink" title="示例代码:"></a><strong>示例代码:</strong></h4><pre class=" language-java"><code class="language-java"><span class="token keyword">package</span> com<span class="token punctuation">.</span>jmd<span class="token punctuation">.</span>web<span class="token punctuation">.</span>listener<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>logging<span class="token punctuation">.</span>log4j<span class="token punctuation">.</span>*<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>*<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>InitializingBean<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>*<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>event<span class="token punctuation">.</span>ContextRefreshedEvent<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>stereotype<span class="token punctuation">.</span>Component<span class="token punctuation">;</span><span class="token keyword">import</span> org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>context<span class="token punctuation">.</span>ServletContextAware<span class="token punctuation">;</span><span class="token keyword">import</span> javax<span class="token punctuation">.</span>servlet<span class="token punctuation">.</span>ServletContext<span class="token punctuation">;</span><span class="token annotation punctuation">@Component</span><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">StartupListener</span> <span class="token keyword">implements</span> <span class="token class-name">ApplicationContextAware</span><span class="token punctuation">,</span> ServletContextAware<span class="token punctuation">,</span> InitializingBean<span class="token punctuation">,</span> ApplicationListener<span class="token operator"><</span>ContextRefreshedEvent<span class="token operator">></span> <span class="token punctuation">{</span> <span class="token keyword">protected</span> Logger logger <span class="token operator">=</span> LogManager<span class="token punctuation">.</span><span class="token function">getLogger</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token annotation punctuation">@Override</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setApplicationContext</span><span class="token punctuation">(</span>ApplicationContext ctx<span class="token punctuation">)</span> <span class="token keyword">throws</span> BeansException <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"1 => StartupListener.setApplicationContext"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token annotation punctuation">@Override</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setServletContext</span><span class="token punctuation">(</span>ServletContext context<span class="token punctuation">)</span> <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"2 => StartupListener.setServletContext"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">//在一个bean中使用@PostConstruct注解的方法会在setServletContext后执行,会在afterPropertiesSet前执行</span> <span class="token annotation punctuation">@Override</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">afterPropertiesSet</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> Exception <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"3 => StartupListener.afterPropertiesSet"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token annotation punctuation">@Override</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">onApplicationEvent</span><span class="token punctuation">(</span>ContextRefreshedEvent evt<span class="token punctuation">)</span> <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"4.1 => MyApplicationListener.onApplicationEvent"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>evt<span class="token punctuation">.</span><span class="token function">getApplicationContext</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getParent</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> null<span class="token punctuation">)</span> <span class="token punctuation">{</span> logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">"4.2 => MyApplicationListener.onApplicationEvent"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p><em>运行时,输出的顺序如下:</em></p><pre class=" language-text"><code class="language-text"> 1 => StartupListener.setApplicationContext 2 => StartupListener.setServletContext 3 => StartupListener.afterPropertiesSet 4.1 => MyApplicationListener.onApplicationEvent 4.2 => MyApplicationListener.onApplicationEvent 4.1 => MyApplicationListener.onApplicationEvent</code></pre><p><strong>注意:</strong> onApplicationEvent方法会触发多次,初始化这种事情,越早越好,建议在setApplicationContext方法中处理。</p>]]></content>
<categories>
<category> JAVA </category>
<category> WEB </category>
</categories>
<tags>
<tag> JAVA </tag>
<tag> JAVA-WEB </tag>
</tags>
</entry>
<entry>
<title>Intellij-Idea 好用的插件</title>
<link href="/2019/04/14/Intellij-Idea-%E5%A5%BD%E7%94%A8%E7%9A%84%E6%8F%92%E4%BB%B6/"/>
<url>/2019/04/14/Intellij-Idea-%E5%A5%BD%E7%94%A8%E7%9A%84%E6%8F%92%E4%BB%B6/</url>
<content type="html"><![CDATA[<h2 id="在使用Intellij-IDEA时发现的好用的插件一览"><a href="#在使用Intellij-IDEA时发现的好用的插件一览" class="headerlink" title="在使用Intellij-IDEA时发现的好用的插件一览"></a>在使用Intellij-IDEA时发现的好用的插件一览</h2><pre class=" language-text"><code class="language-text">JRebelrequest mapper //查找controller等路径映射方便Eclipse Code Formatter 在idea中使用eclipse 格式化配置文件RegexpTester 正则测试工具Builder Generator (1.1.7) 生成 建造者模式的代码.Easy Code (1.1.2-SNAPSHOT) 根据数据库表结构,自动生成代码工具.String Manipulation (6.1.143.000.0) UTF-8字符串转UNICODE,UNICODE转UTF-8字符串Vue.js 对Vue的便捷使用支持File Watchers (182.3911.9) 文件监听器,可以监听less文件自动编译成css,或者监听es6文件,使用babel自动转换成es5代码等功能.NodeJsOro PHPStorm Plugin Plugin for the PHPStorm that will help to increase the development speed on the projects based on the OroPlatform. PHP在idea的支持插件PHP v183.4886.46Pug(ex-Jade) Support for Pug (formerly known as Jade), a template language for JavaScript 一个js后端模板语言Lombok Plugin v0.23-2018.3Jpa Support v1.0.5 Maven Helper v3.7.172.1454.3 Maven 依赖查看Key Promoter X v5.12 查看并提示快捷键操作.gitignore 添加编辑.gitignoreGit Flow Integration git流Translation 翻译</code></pre>]]></content>
<categories>
<category> NOTES </category>
<category> Intellij-IDEA </category>
</categories>
<tags>
<tag> Intellij-IDEA </tag>
</tags>
</entry>
<entry>
<title>JavaWeb项目中获取客户端类型</title>
<link href="/2019/04/14/JavaWeb%E9%A1%B9%E7%9B%AE%E4%B8%AD%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%B1%BB%E5%9E%8B/"/>
<url>/2019/04/14/JavaWeb%E9%A1%B9%E7%9B%AE%E4%B8%AD%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%B1%BB%E5%9E%8B/</url>
<content type="html"><![CDATA[<h2 id="从事JavaWeb项目的开发-总会遇到需要根据不同客户端给予不同响应的需求-这里介绍一个好用的工具包"><a href="#从事JavaWeb项目的开发-总会遇到需要根据不同客户端给予不同响应的需求-这里介绍一个好用的工具包" class="headerlink" title="从事JavaWeb项目的开发,总会遇到需要根据不同客户端给予不同响应的需求,这里介绍一个好用的工具包."></a>从事JavaWeb项目的开发,总会遇到需要根据不同客户端给予不同响应的需求,这里介绍一个好用的工具包.</h2><h3 id="1-引入Maven依赖包"><a href="#1-引入Maven依赖包" class="headerlink" title="1.引入Maven依赖包"></a>1.引入Maven依赖包</h3><p><a href="https://mvnrepository.com/artifact/eu.bitwalker/UserAgentUtils" target="_blank" rel="noopener">UserAgentUtils pom</a></p><pre class=" language-xml"><code class="language-xml"><span class="token comment" spellcheck="true"><!-- 最好使用最新版本的依赖,因为其中所有客户端的软件版本一直在更新中,使用最新的依赖才能准确的得到客户端的类型 --></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>dependency</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>groupId</span><span class="token punctuation">></span></span>eu.bitwalker<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>groupId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>artifactId</span><span class="token punctuation">></span></span>UserAgentUtils<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>artifactId</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>version</span><span class="token punctuation">></span></span>1.21<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>version</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>dependency</span><span class="token punctuation">></span></span></code></pre><h3 id="2-创建一个自己的小工具类"><a href="#2-创建一个自己的小工具类" class="headerlink" title="2.创建一个自己的小工具类"></a>2.创建一个自己的小工具类</h3><pre class=" language-java"><code class="language-java"> <span class="token keyword">public</span> <span class="token keyword">final</span> <span class="token keyword">class</span> <span class="token class-name">ClientExamineUtil</span> <span class="token punctuation">{</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">final</span> String UserAgentHeader <span class="token operator">=</span> <span class="token string">"user-agent"</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">/** * 获取客户端代理对象header值 * @param request * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> String <span class="token function">getUserAgent</span><span class="token punctuation">(</span>HttpServletRequest request<span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token keyword">return</span> request<span class="token punctuation">.</span><span class="token function">getHeader</span><span class="token punctuation">(</span>UserAgentHeader<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">/** * 获取用户代理对象 * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> UserAgent <span class="token function">getUserAgent</span><span class="token punctuation">(</span>String userAgent<span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token keyword">return</span> UserAgent<span class="token punctuation">.</span><span class="token function">parseUserAgentString</span><span class="token punctuation">(</span>userAgent<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">/** * 获取设备类型 * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> DeviceType <span class="token function">getDeviceType</span><span class="token punctuation">(</span>String userAgent<span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token keyword">return</span> <span class="token function">getUserAgent</span><span class="token punctuation">(</span>userAgent<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getOperatingSystem</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getDeviceType</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">/** * 是否是PC * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">boolean</span> <span class="token function">isPc</span><span class="token punctuation">(</span>String userAgent<span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token keyword">return</span> DeviceType<span class="token punctuation">.</span>COMPUTER<span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span><span class="token function">getDeviceType</span><span class="token punctuation">(</span>userAgent<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">/** * 是否是手机 * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">boolean</span> <span class="token function">isMobile</span><span class="token punctuation">(</span>String userAgent<span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token keyword">return</span> DeviceType<span class="token punctuation">.</span>MOBILE<span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span><span class="token function">getDeviceType</span><span class="token punctuation">(</span>userAgent<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">/** * 是否是平板 * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">boolean</span> <span class="token function">isTablet</span><span class="token punctuation">(</span>String userAgent<span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token keyword">return</span> DeviceType<span class="token punctuation">.</span>TABLET<span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span><span class="token function">getDeviceType</span><span class="token punctuation">(</span>userAgent<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment" spellcheck="true">/** * 是否是手机和平板 * @return */</span> <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">boolean</span> <span class="token function">isMobileOrTablet</span><span class="token punctuation">(</span>String userAgent<span class="token punctuation">)</span><span class="token punctuation">{</span> DeviceType deviceType <span class="token operator">=</span> <span class="token function">getDeviceType</span><span class="token punctuation">(</span>userAgent<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">return</span> DeviceType<span class="token punctuation">.</span>MOBILE<span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span>deviceType<span class="token punctuation">)</span> <span class="token operator">||</span> DeviceType<span class="token punctuation">.</span>TABLET<span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span>deviceType<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre><h3 id="3-现在就可以美美地判断请求那头是什么客户端了"><a href="#3-现在就可以美美地判断请求那头是什么客户端了" class="headerlink" title="3.现在就可以美美地判断请求那头是什么客户端了"></a>3.现在就可以美美地判断请求那头是什么客户端了</h3><p> <code>当然,这个工具的用途不止于此,可以根据它现有的功能,实现很多自己想要的功能.</code></p>]]></content>
<categories>
<category> JAVA </category>
</categories>
<tags>
<tag> JAVA </tag>
<tag> JAVA-WEB </tag>
</tags>
</entry>
<entry>
<title>常用HTML Meta标签</title>
<link href="/2019/04/14/%E5%B8%B8%E7%94%A8HTML-Meta%E6%A0%87%E7%AD%BE/"/>
<url>/2019/04/14/%E5%B8%B8%E7%94%A8HTML-Meta%E6%A0%87%E7%AD%BE/</url>
<content type="html"><![CDATA[<pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>author<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>flyTiger<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>description<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>飞虎窗格,github.fhtiger.com<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>keywords<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>fhtiger,ghostFlyTiger,flyTiger,飞虎,窗格,飞虎,窗格<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>title<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>飞虎窗格<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>renderer<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>webkit|ie-comp|ie-stand<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">charset</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>utf-8<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>base</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>/html/<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>X-UA-Compatible<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>IE<span class="token punctuation">=</span>edge<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>width<span class="token punctuation">=</span>device-width, initial-scale<span class="token punctuation">=</span>1,user-scalable<span class="token punctuation">=</span>no<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span><span class="token comment" spellcheck="true"><!-- 不缓存--></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>pragma<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>no-cache<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>cache-control<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>no-cache<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>expires<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>0<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- 定时刷新页面 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">http-equiv</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>refresh<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>0;url<span class="token punctuation">=</span>/staticview/index.jhw.html<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>HandheldFriendly<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- 微软的老式浏览器 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>MobileOptimized<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>320<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- uc强制竖屏 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>screen-orientation<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>portrait<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- QQ强制竖屏 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>x5-orientation<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>portrait<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- UC强制全屏 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>full-screen<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>yes<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- QQ强制全屏 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>x5-fullscreen<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- UC应用模式 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>browsermode<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>application<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- QQ应用模式 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>x5-page-mode<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>app<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- windows phone 点击无高光 --></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>msapplication-tap-highlight<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token comment" spellcheck="true"><!-- 适应移动端end --></span></code></pre>]]></content>
<categories>
<category> HTML </category>
<category> WEB </category>
</categories>
<tags>
<tag> HTML </tag>
<tag> META </tag>
</tags>
</entry>
<entry>
<title>JAVA8 - Lambda表达式的简单应用</title>
<link href="/2019/04/14/JAVA8-Lambda%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%9A%84%E7%AE%80%E5%8D%95%E5%BA%94%E7%94%A8/"/>
<url>/2019/04/14/JAVA8-Lambda%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%9A%84%E7%AE%80%E5%8D%95%E5%BA%94%E7%94%A8/</url>
<content type="html"><![CDATA[<p><strong>前言:</strong> JAVA8带来了很多有趣和高效的新东西,其中Lambda表达式和函数式编程应该是其中最靓的点了.今天我们来简单认识下 JAVA8-Lambda</p><p><strong>首先</strong>,我们来看点小知识,平常我们在写了业务流程后,总不可避免的要构造一些测试数据来验证我们的代码.那么,大家在平时工作中学用的构造数据的方式都有什么呢,这里我来给大家推荐几种快速构造测试数据的小Demo.</p><hr><pre class=" language-java"><code class="language-java"> <span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">JavaTest</span> <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">/** 测试时,经常需要快速初始化一个集合来测试程序. */</span> <span class="token comment" spellcheck="true">// 初始化一个不可变List<Integer></span> <span class="token keyword">static</span> List<span class="token operator"><</span>Integer<span class="token operator">></span> integers <span class="token operator">=</span> Arrays<span class="token punctuation">.</span><span class="token function">asList</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 初始化一个可变List<Integer></span> <span class="token keyword">static</span> List<span class="token operator"><</span>Integer<span class="token operator">></span> edIntegers <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token operator"><</span><span class="token operator">></span><span class="token punctuation">(</span>integers<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 初始化一个可变Set<Integer></span> <span class="token keyword">static</span> Set<span class="token operator"><</span>Integer<span class="token operator">></span> setIntegers <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashSet</span><span class="token operator"><</span><span class="token operator">></span><span class="token punctuation">(</span>integers<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 另类的快速初始化List<String></span> <span class="token keyword">static</span> List<span class="token operator"><</span>String<span class="token operator">></span> strings <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token operator"><</span>String<span class="token operator">></span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token keyword">long</span> serialVersionUID <span class="token operator">=</span> 1L<span class="token punctuation">;</span> <span class="token punctuation">{</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token string">"abc"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token string">"bca"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token string">"acb"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 另类快速初始化一个Map<String,Integer></span> <span class="token keyword">static</span> Map<span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">></span> ages <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">></span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token keyword">long</span> serialVersionUID <span class="token operator">=</span> 1L<span class="token punctuation">;</span> <span class="token punctuation">{</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HP"</span><span class="token punctuation">,</span> <span class="token number">12</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"ASUS"</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HuaWei"</span><span class="token punctuation">,</span> <span class="token number">22</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 另类快速初始化一个List<Map<String,Integer>></span> <span class="token keyword">static</span> List<span class="token operator"><</span>Map<span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">>></span> strAges <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token operator"><</span>Map<span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">>></span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token punctuation">{</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">></span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span> <span class="token punctuation">{</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HP"</span><span class="token punctuation">,</span> <span class="token number">12</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"ASUS"</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HuaWei"</span><span class="token punctuation">,</span> <span class="token number">22</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">></span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token punctuation">{</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HP"</span><span class="token punctuation">,</span> <span class="token number">22</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"ASUS"</span><span class="token punctuation">,</span> <span class="token number">35</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HuaWei"</span><span class="token punctuation">,</span> <span class="token number">42</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">add</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token operator"><</span>String<span class="token punctuation">,</span> Integer<span class="token operator">></span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token punctuation">{</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HP"</span><span class="token punctuation">,</span> <span class="token number">11</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"ASUS"</span><span class="token punctuation">,</span> <span class="token number">25</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">put</span><span class="token punctuation">(</span><span class="token string">"HuaWei"</span><span class="token punctuation">,</span> <span class="token number">32</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">;</span></code></pre><hr><h3 id="接下来我们来用-Lambda-表达式来操作这些数据"><a href="#接下来我们来用-Lambda-表达式来操作这些数据" class="headerlink" title="接下来我们来用 Lambda 表达式来操作这些数据."></a>接下来我们来用 Lambda 表达式来操作这些数据.</h3><h4 id="1-我们在测试中对数据常用的就是遍历-我们在测试类中添加如下方法"><a href="#1-我们在测试中对数据常用的就是遍历-我们在测试类中添加如下方法" class="headerlink" title="1.我们在测试中对数据常用的就是遍历,我们在测试类中添加如下方法:"></a>1.我们在测试中对数据常用的就是遍历,我们在测试类中添加如下方法:</h4><pre class=" language-java"><code class="language-java"> <span class="token comment" spellcheck="true">/** 资源遍历 */</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">each</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">// 遍历List测试.</span> integers<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>1 2 3 4 5 5</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> edIntegers<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>1 2 3 4 5 5</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> setIntegers<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>1 2 3 4 5</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> strings<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>abc bca acb</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 遍历Map测试</span> ages<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span>key<span class="token punctuation">,</span> value<span class="token punctuation">)</span> <span class="token operator">-</span><span class="token operator">></span> <span class="token punctuation">{</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">"{"</span> <span class="token operator">+</span> key <span class="token operator">+</span> <span class="token string">":"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>value <span class="token operator">+</span> <span class="token string">"}"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>{HP:12} {HuaWei:22} {ASUS:15}</span> <span class="token punctuation">}</span></code></pre><p>在main方法中调用此 each() 方法即可看到上述执行结果.</p><h4 id="2-java8-中流的-sorted-排序让数据集的排序变得更简单明了-同样我们创建如下方法并在-main方法中调用"><a href="#2-java8-中流的-sorted-排序让数据集的排序变得更简单明了-同样我们创建如下方法并在-main方法中调用" class="headerlink" title="2.java8 中流的 sorted 排序让数据集的排序变得更简单明了,同样我们创建如下方法并在 main方法中调用 ."></a>2.java8 中流的 sorted 排序让数据集的排序变得更简单明了,同样我们创建如下方法并在 main方法中调用 .</h4><pre class=" language-java"><code class="language-java"> <span class="token comment" spellcheck="true">/** 资源排序 */</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">sorted</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">// List 排序 Comparator.reverseOrder() 是将顺序颠倒.</span> integers<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">sorted</span><span class="token punctuation">(</span>Comparator<span class="token punctuation">.</span><span class="token function">reverseOrder</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>5 5 4 3 2 1</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> strings<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">sorted</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>abc acb bca</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> strings<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">sorted</span><span class="token punctuation">(</span>Comparator<span class="token punctuation">.</span><span class="token function">reverseOrder</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>bca acb abc</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// List<Map> 根据某字段排序</span> strAges<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">sorted</span><span class="token punctuation">(</span><span class="token punctuation">(</span>a<span class="token punctuation">,</span> b<span class="token punctuation">)</span> <span class="token operator">-</span><span class="token operator">></span> <span class="token punctuation">{</span> <span class="token keyword">return</span> a<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">"HP"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">compareTo</span><span class="token punctuation">(</span>b<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">"HP"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>x <span class="token operator">-</span><span class="token operator">></span> <span class="token punctuation">{</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">print</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>{HP=11, HuaWei=32, ASUS=25} {HP=12, HuaWei=22, ASUS=15} {HP=22, HuaWei=42, ASUS=35}</span> <span class="token punctuation">}</span></code></pre><h4 id="3-java8中stream的-filter提供了一种简单的过滤数据集得到我们想要的结果集的方法"><a href="#3-java8中stream的-filter提供了一种简单的过滤数据集得到我们想要的结果集的方法" class="headerlink" title="3. java8中stream的 filter提供了一种简单的过滤数据集得到我们想要的结果集的方法."></a>3. java8中stream的 filter提供了一种简单的过滤数据集得到我们想要的结果集的方法.</h4><pre class=" language-java"><code class="language-java"> <span class="token comment" spellcheck="true">/** 资源过滤 */</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">filter</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">// List 过滤</span> integers<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">filter</span><span class="token punctuation">(</span>x <span class="token operator">-</span><span class="token operator">></span> x<span class="token punctuation">.</span><span class="token function">compareTo</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">></span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// => 2 3 4 5 5</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> strings<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">filter</span><span class="token punctuation">(</span>x <span class="token operator">-</span><span class="token operator">></span> x<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span><span class="token string">"a"</span><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>abc acb</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// List<Map> 根据某字段过滤</span> strAges<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">filter</span><span class="token punctuation">(</span>x <span class="token operator">-</span><span class="token operator">></span> x<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">"ASUS"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">compareTo</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span> <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// =>{HP=22, HuaWei=42, ASUS=35} {HP=11, HuaWei=32, ASUS=25}</span> <span class="token punctuation">}</span></code></pre><h4 id="4-有时候我们需要将集合中的数据进行一定方式处理后返回-以满足我们的应用场景-java8-stream的map可以满足你的需求"><a href="#4-有时候我们需要将集合中的数据进行一定方式处理后返回-以满足我们的应用场景-java8-stream的map可以满足你的需求" class="headerlink" title="4. 有时候我们需要将集合中的数据进行一定方式处理后返回,以满足我们的应用场景.java8 stream的map可以满足你的需求."></a>4. 有时候我们需要将集合中的数据进行一定方式处理后返回,以满足我们的应用场景.java8 stream的map可以满足你的需求.</h4><pre class=" language-java"><code class="language-java"> <span class="token comment" spellcheck="true">/** 资源转换 */</span> <span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">transfer</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">// 取List<Map>中一个字段组成新的List</span> List<span class="token operator"><</span>Integer<span class="token operator">></span> ASUS_Ages <span class="token operator">=</span> strAges<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">map</span><span class="token punctuation">(</span>x <span class="token operator">-</span><span class="token operator">></span> x<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">"ASUS"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">collect</span><span class="token punctuation">(</span>Collectors<span class="token punctuation">.</span><span class="token function">toList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> ASUS_Ages<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>System<span class="token punctuation">.</span>out<span class="token operator">:</span><span class="token operator">:</span>print<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// =>15 35 25</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">// 将List<Integer> 中元素求和</span> Integer ages <span class="token operator">=</span> ASUS_Ages<span class="token punctuation">.</span><span class="token function">stream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token punctuation">(</span>a<span class="token punctuation">,</span> b<span class="token punctuation">)</span> <span class="token operator">-</span><span class="token operator">></span> a <span class="token operator">+</span> b<span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>ages<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">// => 75</span> <span class="token punctuation">}</span></code></pre><h3 id="大家看得过瘾不-希望每天都有进步哦"><a href="#大家看得过瘾不-希望每天都有进步哦" class="headerlink" title="大家看得过瘾不? 希望每天都有进步哦!"></a>大家看得过瘾不? 希望每天都有进步哦!</h3><h4 id="最后附上-main中代码"><a href="#最后附上-main中代码" class="headerlink" title="最后附上 main中代码."></a>最后附上 main中代码.</h4><pre class=" language-java"><code class="language-java"> <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span>String<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token function">each</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">sorted</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">filter</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token function">transfer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre>]]></content>
<categories>
<category> JAVA </category>
</categories>
<tags>
<tag> JAVA </tag>
<tag> JAVA8 </tag>
</tags>
</entry>
</search>