Re: [Maven-js-plugin-developers] 1.4 POM.XML files
Brought to you by:
mvaaltemus
|
From: Todd O. <to...@mo...> - 2009-07-29 15:07:56
|
I would like to make a suggestion to the configuration section. How about
complex more like this:
<plugin>
<groupId>com.mobilvox.ossi.mojo</groupId>
<artifactId>maven-js-plugin</artifactId>
<version>1.4</version>
<!-- The plugin configuration -->
<configuration>
<webapp>
...configuration...
</webapp>
<site>
...configuration...
</site>
<custom>
...configuration...
</custom>
</configuration>
<!-- Tie the compress goal to the package phase. -->
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
</plugin>
This more clearly breaks configuration down into the available compression
tasks, webapp, site, and custom. This helps the users know exactly what is
going on with the js-compress cycles. And further implementation might look
like this (the specified options in webapp, site, and custom are only
examples and are probably not correct.):
<plugin>
<groupId>com.mobilvox.ossi.mojo</groupId>
<artifactId>maven-js-plugin</artifactId>
<version>1.4</version>
<!-- The plugin configuration -->
<configuration>
<webapp>
<compress>true</compress>
<!-- Whether to merge the WAR files into one or not.
-->
<mergeWarFiles>false</mergeWarFiles>
<!-- The classifier for compressed files. -->
<classifier>js-compressed</classifier>
</webapp>
<site>
<compress>true</compress>
</site>
<custom>
<compress>true</compress>
<!-- Includes and excludes for compression -->
<includes>
<include>**/**.js</include>
</includes>
<excludes>
<exclude>**/dir1/js/**</exclude>
<exclude>**/dir/**</exclude>
</excludes>
<!-- Any license files to be included in the header of
the JS files. -->
<licenseFiles>
<licenseFile>target/js/license.txt</licenseFile>
</licenseFiles>
<!-- Input and output directories for the custom MOJO.
-->
<jsDirectory>target/site/js</jsDirectory>
<outputDirectory>target/site/js</outputDirectory>
</custom>
</configuration>
<!-- Tie the compress goal to the package phase. -->
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
</plugin>
Advantages are that options can be defined for specific compression schemes,
webapp, site, and custom. There could also be "global" compress options
available that would be configured above webapp.
-Todd
From: Adam Altemus [mailto:aal...@mo...]
Sent: Tuesday, July 28, 2009 10:41 AM
To: mav...@li...
Subject: [Maven-js-plugin-developers] 1.4 POM.XML files
I have completed two initial POM files, a simple and a complex. I like that
the simple is the same as it was but, the complex seems a bit much for me.
I am not sure, however, where to cut and keep the functionality we have
plus add more. I have moved all custom defined parameters to a custom
element but, beyond that any input is appreciated. I am including them
below.
Simple POM
<plugin>
<!-- Defaults to WAR compression -->
<groupId>com.mobilvox.ossi.mojo</groupId>
<artifactId>maven-js-plugin</artifactId>
<version>1.4</version>
</plugin>
Complex POM
<plugin>
<groupId>com.mobilvox.ossi.mojo</groupId>
<artifactId>maven-js-plugin</artifactId>
<version>1.4</version>
<!-- The plugin configuration -->
<configuration>
<!-- Whether to merge the WAR files into one or not. -->
<mergeWarFiles>false</mergeWarFiles>
<!-- The classifier for compressed files. -->
<classifier>js-compressed</classifier>
<!-- Whether to replace JS files in the site and custom goals. -->
<replaceJavaScript>true</replaceJavaScript>
<!-- Compression flags for which compression will be run during
the compress goal. Default is to run WAR compression. Compress
custom is not needed since the custom element is defined.-->
<compress-war>true</compress-war>
<compress-site>true</compress-site>
<!-- User defined paramaters -->
<custom>
<!-- Includes and excludes for compression -->
<includes>
<include>**/**.js</include>
</includes>
<excludes>
<exclude>**/dir1/js/**</exclude>
<exclude>**/dir/**</exclude>
</excludes>
<!-- Any license files to be included in the header of the JS
files. -->
<licenseFiles>
<licenseFile>target/js/license.txt</licenseFile>
</licenseFiles>
<!-- Input and output directories for the custom MOJO. -->
<jsDirectory>target/site/js</jsDirectory>
<outputDirectory>target/site/js</outputDirectory>
</custom>
</configuration>
<!-- Tie the compress goal to the package phase. -->
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
</plugin>
Adam Altemus
Senior Software Engineer
(724) 349-3339 ext. 302
(800) 830-5578 fax
aaltemus at mobilvox dot com
http://www.mobilvox.com <http://www.mobilvox.com/>
Confidentiality Notice: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
immediately notify the sender by reply e-mail and destroy all information
and attachments.
|