鍏充簬jenkins鐨勪嬌鐢ㄥ強(qiáng)鑷姩鍖栭厤緗楠わ紝鍦ㄦ湰鍗氫笂綃囧凡緇忔湁鎵浠嬬粛錛岃繖閲屽彧鍒椾笅濡備綍浣跨敤maven鐨勫己澶ф彃浠禷ssembly
1銆佸亣璁鵑潤鎬佽祫婧愮殑鐩綍緇撴瀯涓猴細(xì)
static/js/xxxx
static/css/xxxx
static/images/xxxx
static/configure/xxx.js
static/pom.xml
static/assembly.xml
2銆侀厤緗畃om.xml
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 <modelVersion>4.0.0</modelVersion>
4 <groupId>com.test</groupId>
5 <artifactId>static</artifactId>
6 <packaging>pom</packaging>
7 <version>1.0</version>
8
9 <properties>
10 <fileName>static</fileName>
11 <SettingJs>configure/xxx.js</SettingJs>
12 </properties>
13
14 <build>
15 <finalName>${fileName}</finalName>
16
17 <plugins>
18 <plugin>
19 <groupId>org.apache.maven.plugins</groupId>
20 <artifactId>maven-antrun-plugin</artifactId>
21 <version>1.6</version>
22 <executions>
23 <execution>
24 <id>compile</id>
25 <phase>compile</phase>
26 <configuration>
27 <target>
28 <copy file="${SettingJs}" tofile="js/xxx.js"
29 overwrite="true" />
30 </target>
31 </configuration>
32 <goals>
33 <goal>run</goal>
34 </goals>
35 </execution>
36 </executions>
37 </plugin>
38
39 <plugin>
40 <groupId>org.apache.maven.plugins</groupId>
41 <artifactId>maven-assembly-plugin</artifactId>
42 <version>2.2.1</version>
43 <configuration>
44 <descriptors>
45 <descriptor>assembly.xml</descriptor>
46 </descriptors>
47 </configuration>
48 <executions>
49 <execution>
50 <id>make-assembly</id>
51 <phase>package</phase>
52 <goals>
53 <goal>single</goal>
54 </goals>
55 </execution>
56 </executions>
57 </plugin>
58 </plugins>
59 </build>
60 </project>
3銆侀厤緗產(chǎn)ssembly.xml
1 <assembly
2 xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
5 <id>all</id>
6 <formats>
7 <format>zip</format>
8 </formats>
9
10 <fileSets>
11 <fileSet>
12 <directory>js</directory>
13 <useDefaultExcludes>true</useDefaultExcludes>
14 </fileSet>
15 <fileSet>
16 <directory>images</directory>
17 <useDefaultExcludes>true</useDefaultExcludes>
18 </fileSet>
19 <fileSet>
20 <directory>css</directory>
21 <useDefaultExcludes>true</useDefaultExcludes>
22 </fileSet>
23 </fileSets>
24 </assembly>
4銆乯enkins涓紝褰撴瀯寤轟換鍔$粨鏉熷悗錛屽皢鐢熸垚static-all.zip鏂囦歡錛岄厤緗嚜鍔ㄤ笂浼犺嚦鐩爣鏈嶅姟鍣紝鏈鍚庝嬌鐢ㄥ懡浠nzip -o static-all.zip瑙e帇瑕嗙洊鍗沖彲
鎶鏈枃绔犳敹钘忕珯鐐?/a>
]]>