Reputation: 6420
I need to exclude libaries (like jquery, knockoutjs, jqueryMobile and some extentions...) for jsHint.
but for the other goals I need them all.
EDIT:
I've created 2 wro files but still it takes all targetGroups.
wro2.xml with utils,app wro.xml with utils,libraries,app,jQueryMobile
<plugins>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>ex1</id>
<goals>
<goal>jshint</goal>
</goals>
</execution>
</executions>
<configuration>
<!--jshint options-->
<options>jquery,devel,evil,noarg,eqnull</options>
<failNever>false</failNever>
<targetGroups>utils,app</targetGroups>
<wroFile>${basedir}/src/main/webapp/WEB-INF/wro2.xml</wroFile>
</configuration>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>ex2</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<!--compile options-->
<targetGroups>utils,libraries,app,jQueryMobile</targetGroups>
<minimize>true</minimize>
<destinationFolder>${basedir}/src/main/webapp/wro/</destinationFolder>
<cssDestinationFolder>${basedir}/target/webapp/css/</cssDestinationFolder>
<jsDestinationFolder>${basedir}/target/webapp/js/</jsDestinationFolder>
<contextFolder>${basedir}/src/main/webapp/</contextFolder>
<ignoreMissingResources>false</ignoreMissingResources>
<wroFile>${basedir}/src/main/webapp/WEB-INF/wro.xml</wroFile>
<wroManagerFactory>ro.isdc.wro.extensions.manager.standalone.GoogleStandaloneManagerFactory</wroManagerFactory>
</configuration>
</plugin>
</plugins>
Upvotes: 1
Views: 2917
Reputation: 4133
You have the following options:
In either case, you'll have to declare the plugin twice in pom.xml, since the configuration options will differ.
EDIT:
The solution is related to maven execution configuration rather than to wro4j-maven-plugin.
So, instead of declaring the same plugin twice with different configurations, you declare it once with two executions and each execution has its own configuration. Example:
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>ex1</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<targetGroups>utils,libraries,app,jQueryMobile</targetGroups>
</configuration>
</execution>
<execution>
<id>ex2</id>
<goals>
<goal>jshint</goal>
</goals>
<configuration>
<options>jquery,devel,evil,noarg,eqnull</options>
<failNever>false</failNever>
<targetGroups>utils,app</targetGroups>
<wroFile>${basedir}/src/main/webapp/WEB-INF/wro2.xml</wroFile>
</configuration>
</execution>
</executions>
</plugin>
Upvotes: 2