日期:2014-05-16  浏览次数:20586 次

maven打包压缩css js
<plugins>
			<plugin>
				<groupId>net.alchim31.maven</groupId>
				<artifactId>yuicompressor-maven-plugin</artifactId>
				<version>1.3.0</version>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<goals>
							<goal>compress</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<includes>
						<include>**/*.js</include>
						<include>**/*.css</include>
					</includes>
					<excludes>
						<exclude>**/*.min.js</exclude>
						<exclude>**/*-min.js</exclude>
					</excludes>
					<encoding>utf8</encoding>
					<failOnWarning>false</failOnWarning>
					<force>true</force>
					<nosuffix>true</nosuffix>
					<linebreakpos>-1</linebreakpos>
					<sourceDirectory>${basedir}/resources</sourceDirectory>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<warSourceExcludes>
						**/*.js,**/*.css
					</warSourceExcludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<source>6</source>
					<target>6</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
		</plugins>

?