# Can I access War properties when configuring a plugin using RuleSource?

**URL:** https://discuss.gradle.org/t/can-i-access-war-properties-when-configuring-a-plugin-using-rulesource/15275
**Category:** Help/Discuss
**Tags:** jvm-software-model, plugins
**Created:** [March 18, 2016, 7:32pm UTC](https://discuss.gradle.org/t/can-i-access-war-properties-when-configuring-a-plugin-using-rulesource/15275 "2016-03-18T19:32:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Appu\_Goundan](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/appu_goundan/32/774_2.png) [@Appu\_Goundan](https://discuss.gradle.org/u/Appu_Goundan)
#### Post date: [March 18, 2016, 7:32pm UTC](https://discuss.gradle.org/t/can-i-access-war-properties-when-configuring-a-plugin-using-rulesource/15275/1 "2016-03-18T19:32:28Z")

</div>

I have a Rule based plugin and I’m trying to get properties of the War plugin from the convention but it’s not available in the general model space.

I want to create tasks conditionally on

1. the war plugin being applied
2. the WEB-INF dir contains some specific file “XYZ.xml”

In old style code I could have done something like

```gradle
1. if (project.hasProperty('war')) { // do something }
2. project.convention.getPlugin(WarPluginConvention).webAppDir ... and then find a file

```

What’s the equivalent of this in the Rule based configuration model? Is the War plugin not setup yet to allow interactions with rule configured plugins? The closest I got was accessing the war task using a @Path(‘tasks.war’) kind of situation but I can’t find enough information from that task, also presumably the behavior is bad if the path doesn’t exist?

Ideally I would like to do something like

```gradle
@Mutate createSomeWarBasedTask(.... params....) {
  if ( hasWarPlugin() ) {
    // do something
    warPlugin.getAppDir().findSomeFile()...

```

---

<div class="post-metadata">

### Author: ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)
#### Post date: [March 18, 2016, 8:09pm UTC](https://discuss.gradle.org/t/can-i-access-war-properties-when-configuring-a-plugin-using-rulesource/15275/2 "2016-03-18T20:09:24Z")

</div>

The war plugin is not yet based on rule based configuration, so this is not yet possible.
