Closed davidjnelson closed 12 years ago
Hi David,
I'd be glad to add the feature if needed, but you can get a similar effect with profiles. If your plugin's default execution has an id of optimize
, then you could use a profile like this to conditionally disable the plugin:
<profile>
<id>skip-optimize</id>
<build>
<plugins>
<plugin>
<groupId>com.github.mcheely</groupId>
<artifactId>requirejs-maven-plugin</artifactId>
<executions>
<execution>
<id>optimize</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Does that work for your use case? If not let me know, and I'll add a config option.
Hi Matthew,
Thank you so much! This is great. I had a hard time getting profiles to work previously and thought they wouldn't work for this use case. However, your help here was what got it working for me.
However, to get it working for my use case I had to do it slightly differently.
I removed the plugin from the regular build, and added it only to its own build profile. So by default it is off:
<profile>
<id>optimize</id>
<build>
<plugins>
<plugin>
<groupId>com.github.mcheely</groupId>
<artifactId>requirejs-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>optimize</goal>
</goals>
</execution>
</executions>
<configuration>
<configFile>
${basedir}/requirejs-build/app.build.js
</configFile>
<optimizerFile>
${basedir}/requirejs-build/r.js
</optimizerFile>
<filterConfig>
false
</filterConfig>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Then, in my continuous integration server (teamcity) I just pass:
-P optimize
and it works great!
Thanks Matthew!!
Glad I could help!
You're awesome man!
Hi Matthew,
Sometimes we need to run mvn test and waiting for optimize to run takes forever. A skip flag here would be perfect.
If you want me to add this and submit a pull request let me know. The painful part for me is getting it in maven. We have a private maven repo for modified open source code but it's kind of a pain to use.
Thanks, David