天天看点

maven 压缩js

<profile>
            <id>env.production</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-ant-plugin</artifactId>
                        <!-- configuration -->
                        <configuration>
                            <target>
                                <taskdef name="compress" classname="com.meizu.tools.yuicompress.YUICompressTask"/>
                                <compress linebreak="150" warn="false" 
                                    munge="false" charset="UTF-8" 
                                    skipError="false" preserveallsemicolons="true"
                                    outputfolder="${project.build.directory}/${project.artifactId}-${project.version}/yard/min">
                                     <fileset dir="${project.build.directory}/${project.artifactId}-${project.version}/yard">
                                        <include name="**/*.js" />
                                    </fileset>
                                </compress>                        
                            </target>
                        </configuration>
                    </plugin>
                    
                </plugins>
            </build>
        </profile>      

转载于:https://www.cnblogs.com/jantollong/p/3369806.html