我想知道如何使用Maven压缩JavaScript文件。我已经访问了像http://mojohaus.org/javascript-maven-tools/guide-webapp-development.html这样的网站,但没有详细的实现说明。
我想知道执行Maven插件所需的依赖项。
我想知道如何使用Maven压缩JavaScript文件。我已经访问了像http://mojohaus.org/javascript-maven-tools/guide-webapp-development.html这样的网站,但没有详细的实现说明。
我想知道执行Maven插件所需的依赖项。
yuicompressor:compress
目标。该工具有完整的文档,易于使用。pluginRepository
: <pluginRepositories>
<pluginRepository>
<name>oss.sonatype.org - github-releases</name>
<id>oss.sonatype.org-github-releases</id>
<url>http://oss.sonatype.org/content/repositories/github-releases</url>
</pluginRepository>
</pluginRepositories>
并声明插件:
<project>
...
<build>
<!-- To define the plugin version in your parent POM -->
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>0.9</version>
</plugin>
...
</plugins>
</pluginManagement>
<!-- To use the plugin goals in your POM or parent POM -->
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
...
</project>
preserveAllSemiColons
),这样它就可以删除换行符了。 - Pascal Thivent