Wro4j Maven Plugin - Uglify Plugin

252 views
Skip to first unread message

dam...@3dissue.com

unread,
May 15, 2015, 12:00:39 PM5/15/15
to wr...@googlegroups.com
Hi

I am using your maven plugin and I am very impressed

My configuration so far is as follows

 <plugin>
    <groupId>ro.isdc.wro4j</groupId>
    <artifactId>wro4j-maven-plugin</artifactId>
<executions>
     <execution>
       <phase>compile</phase>
       <goals>
         <goal>run</goal>
       </goals>
     </execution>
   </executions>
<configuration>
      <targetGroups>all</targetGroups>
      <minimize>true</minimize>
      <uglifyJs>true</uglifyJs>
       <destinationFolder>${project.basedir}/WebContent/wro/</destinationFolder>
      <cssDestinationFolder>${project.basedir}/WebContent/wro/static/css/</cssDestinationFolder>
      <jsDestinationFolder>${project.basedir}/WebContent/wro/static/js/</jsDestinationFolder>
      <contextFolder>${basedir}/WebContent/WEB-INF/templates/slim/client</contextFolder>
      <wroFile>${project.basedir}/WebContent/WEB-INF/wro.xml</wroFile>
      <!-- <wroManagerFactory>com.mycompany.MyCustomWroManagerFactory</wroManagerFactory>-->
      <ignoreMissingResources>false</ignoreMissingResources>
    </configuration>       
  </plugin>

I was wondering how can I use your plugin to uglify my javascript code?
Can I add a property in the pom.xml file?

I havent found anything related to this online as of yet

Thank you
Damien

Alex Objelean

unread,
May 15, 2015, 12:06:55 PM5/15/15
to wr...@googlegroups.com
Hi Damien,

there is no such configuration as uglifyJs in the plugin. All valid options are documented here.
What you need, is to use the ConfigurableWroManagerFactory (which is documented on the provided location as well) and update the wro.properties configuration file with the pre/post processors you need (in that case the uglifyJs or googleClosureSimple processor. The list of all available processors is documented here.

Let me know if that helps.

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/d/optout.

dam...@3dissue.com

unread,
May 18, 2015, 10:36:20 AM5/18/15
to wr...@googlegroups.com
Hi Alex

Perfect thank you very much for informing me of this - this is exactly what I need

Thank you
Damien
Reply all
Reply to author
Forward
0 new messages