[MNT-23888] Added initial code for adding closure plugin

This commit is contained in:
suneet-gupta
2023-10-12 12:38:48 +05:30
parent 20d4486da9
commit b76b80cde4

View File

@@ -288,12 +288,12 @@
</plugin> </plugin>
<!-- Compress JavaScript files and store as *-min.js --> <!-- Compress JavaScript files and store as *-min.js -->
<plugin> <!-- <plugin>
<groupId>net.alchim31.maven</groupId> <groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId> <artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version> <version>1.5.1</version>
<executions> <executions>
<!-- Compress the JS files under the assembly folder --> &lt;!&ndash; Compress the JS files under the assembly folder &ndash;&gt;
<execution> <execution>
<id>compress-assembly</id> <id>compress-assembly</id>
<goals> <goals>
@@ -315,7 +315,7 @@
<jswarn>false</jswarn> <jswarn>false</jswarn>
</configuration> </configuration>
</execution> </execution>
<!-- Compress the JS files under the resources folder --> &lt;!&ndash; Compress the JS files under the resources folder &ndash;&gt;
<execution> <execution>
<id>compress-resources</id> <id>compress-resources</id>
<goals> <goals>
@@ -335,6 +335,71 @@
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin>-->
<plugin>
<groupId>com.github.blutorange</groupId>
<artifactId>closure-compiler-maven-plugin</artifactId>
<version>2.27.0</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<baseSourceDir>${project.basedir}/src/main/assembly</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main/assembly</baseTargetDir>
<sourceDir>web</sourceDir>
<targetDir>web</targetDir>
<skipMerge>true</skipMerge>
<skip>${minifyRequiredInAssembly}</skip>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<baseSourceDir>${project.basedir}/src/main</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main</baseTargetDir>
<sourceDir>resources</sourceDir>
<targetDir>resources</targetDir>
<skipMerge>true</skipMerge>
<skip>${minifyRequiredInResources}</skip>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
</configuration>
</execution>
</executions>
</plugin> </plugin>
<!-- Hot reloading with JRebel --> <!-- Hot reloading with JRebel -->