size of maven-generated war

68 views
Skip to first unread message

Rohi Fadlun

unread,
Nov 17, 2013, 5:02:40 AM11/17/13
to wr...@googlegroups.com
Hi,
I don't know if it's a problem in my configuration, but when I use wro4j in build mode (by adding the <plugin> in the pom.xml) the generated .war gets extemely fat, arriving to almost 60MB in size!
On the contrary, if I package the war without the plugin (so using wro4j in runtime mode) i get it in normal size (12MB) as expected.
This is in my pom.xml
<plugin>
       
<groupId>ro.isdc.wro4j</groupId>
       
<artifactId>wro4j-maven-plugin</artifactId>
       
<version>${wro4j.version}</version>
       
<executions>
           
<execution>
               
<phase>compile</phase>
               
<goals>
                   
<goal>run</goal>
               
</goals>
           
</execution>
       
</executions>
         
<configuration>
           
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/resources/js</jsDestinationFolder>
           
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/resources/styles</cssDestinationFolder>
         
<wroFile>WebContent/WEB-INF/wro.xml</wroFile>
         
</configuration>
       
</plugin>

While this is my wro.properties
managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory
gzipResources
=true
hashStrategy
=MD5
namingStrategy
=hashEncoder-CRC32
#list of preprocessors
preProcessors
=cssUrlRewriting,cssImport,semicolonAppender,cssMinJawr
#list of postprocessors
postProcessors
=cssVariables,jsMin


Opening the generated .war, I see that there are too many dependencies downloaded by the plugin, that I'm not using, such as: various ant, bourbon, clojure, gmaven, groovy, various jnr, less, etc etc.
So basically wro4j is downloading as dependencies ALL the possible plugins he has in its list..... is this normal? Is there a way to limit this behaviour to only the basic plugins needed (defined in the wro.properties file) ?

Thanks a lot,

Rohi

Alex Objelean

unread,
Nov 17, 2013, 6:34:17 AM11/17/13
to wr...@googlegroups.com
Hi Rohi,

the wro4j maven plugin uses wro4j-extensions module dependency by default, which has a large amount of transitive dependencies. This is a known problem and there is an open issue which aims to split wro4j-extensions module into smaller focused modules. Until this issue fixed, there is a solution: explicitly exclude the dependencies you don't need (those related to groovy, jruby, etc).

Cheers,
Alex 


--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/groups/opt_out.

Rohi Fadlun

unread,
Nov 17, 2013, 11:02:00 AM11/17/13
to wr...@googlegroups.com
Thanks Alex! Sorry I didn't see this was an open issue...
Until this feature is developed, is it possible to have a table that explains which dependency each extension need? 
Of course some are obvious, but there are others that are not.

Looking forward for further development of split modules. Until now (2 days since I started) I'm very happy about wro4j!

Thanks!

Rohi
Reply all
Reply to author
Forward
0 new messages