Bladeren bron

静态资源分离插件

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@1114 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
administrator 10 jaren geleden
bovenliggende
commit
17dc4f9298
1 gewijzigde bestanden met toevoegingen van 62 en 11 verwijderingen
  1. 62 11
      pom.xml

+ 62 - 11
pom.xml

@@ -208,15 +208,31 @@
 				</goals> 远程服务器的相关配置 <configuration> <hostname>60.host</hostname> <port>9999</port> 
 				用户名和密码为jboss as 中添加的用户名和密码 <username>administrator</username> <password>select111***</password> 
 				</configuration> </execution> </executions> </plugin> -->
-			<!-- <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> 
-				<version>2.2</version> <executions> <execution> <phase>install</phase> <goals> 
-				<goal>deploy</goal> </goals> <configuration> <url>http://60.host:9090/manager/text</url> 
-				<username>administrator</username> <password>select111***</password> <path>/platform-b2b</path> 
-				<update>true</update> </configuration> </execution> </executions> </plugin> -->
+			<!-- <plugin>
+				<groupId>org.apache.tomcat.maven</groupId>
+				<artifactId>tomcat7-maven-plugin</artifactId>
+				<version>2.2</version>
+				<executions>
+					<execution>
+						<phase>install</phase>
+						<goals>
+							<goal>deploy</goal>
+						</goals>
+						<configuration>
+							<url>http://60.host:9090/manager/text</url>
+							<username>administrator</username>
+							<password>select111***</password>
+							<path>/platform-b2b</path>
+							<update>true</update>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin> -->
 			<plugin>
 				<groupId>com.samaxes.maven</groupId>
 				<artifactId>minify-maven-plugin</artifactId>
 				<version>1.7.4</version>
+				<!-- 静态文件压缩 -->
 				<executions>
 					<execution>
 						<id>default-minify</id>
@@ -228,21 +244,24 @@
 							<closureAngularPass>true</closureAngularPass>
 							<nosuffix>true</nosuffix>
 							<webappTargetDir>${project.build.directory}/minify</webappTargetDir>
-							<cssSourceDir>resources/css</cssSourceDir>
+							<cssSourceDir>/</cssSourceDir>
 							<cssEngine>YUI</cssEngine>
-							<jsSourceDir>resources/js</jsSourceDir>
+							<jsSourceDir>resources</jsSourceDir>
 							<jsEngine>CLOSURE</jsEngine>
 							<cssSourceIncludes>
-								<cssSourceInclude>**/*.css</cssSourceInclude>
+								<cssSourceInclude>resources/css/**/*.css</cssSourceInclude>
+								<cssSourceInclude>resources/tpl/**/*.html</cssSourceInclude>
+								<cssSourceInclude>WEB-INF/views/**/*.html</cssSourceInclude>
+								<cssSourceInclude>resources/data/**/*.json</cssSourceInclude>
 							</cssSourceIncludes>
 							<cssSourceExcludes>
-								<cssSourceExclude>**/*.min.css</cssSourceExclude>
+								<cssSourceExclude>resources/css/**/*.min.css</cssSourceExclude>
 							</cssSourceExcludes>
 							<jsSourceIncludes>
-								<jsSourceInclude>**/*.js</jsSourceInclude>
+								<jsSourceInclude>js/**/*.js</jsSourceInclude>
 							</jsSourceIncludes>
 							<jsSourceExcludes>
-								<jsSourceExclude>**/*.min.js</jsSourceExclude>
+								<jsSourceExclude>js/**/*.min.js</jsSourceExclude>
 							</jsSourceExcludes>
 						</configuration>
 						<goals>
@@ -251,12 +270,44 @@
 					</execution>
 				</executions>
 			</plugin>
+ 			<plugin>
+				<groupId>com.uas.plugins</groupId>
+				<artifactId>static-maven-plugin</artifactId>
+				<version>0.0.1-SNAPSHOT</version>
+				<!-- 静态资源分离 -->
+				<executions>
+					<execution>
+						<id>default-static</id>
+						<phase>prepare-package</phase>
+						<configuration>
+							<pathMatcher>static</pathMatcher>
+							<staticUrl>http://static.ubtob.com</staticUrl>
+							<webappDir>${project.build.directory}/minify</webappDir>
+							<sourceDir>/</sourceDir>
+							<targetDir>${project.build.directory}/statics</targetDir>
+							<staticDir>/</staticDir>
+							<sourceIncludes>
+								<sourceInclude>resources/js/**/*.js</sourceInclude>
+								<sourceInclude>resources/data/**/*.json</sourceInclude>
+								<sourceInclude>resources/tpl/**/*.html</sourceInclude>
+								<sourceInclude>WEB-INF/views/**/*.html</sourceInclude>
+							</sourceIncludes>
+						</configuration>
+						<goals>
+							<goal>static</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-war-plugin</artifactId>
 				<version>2.4</version>
 				<configuration>
 					<webResources>
+						<resource>
+							<directory>${project.build.directory}/statics</directory>
+						</resource>
 						<resource>
 							<directory>${project.build.directory}/minify</directory>
 						</resource>