# EJB client gradle plugin

**URL:** <https://discuss.gradle.org/t/ejb-client-gradle-plugin/26312>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [March 19, 2018, 10:13pm UTC](https://discuss.gradle.org/t/ejb-client-gradle-plugin/26312 "2018-03-19T22:13:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daggerok](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daggerok/32/7757_2.png) [@daggerok](https://discuss.gradle.org/u/daggerok)\
**Post date:** [March 19, 2018, 10:13pm UTC](https://discuss.gradle.org/t/ejb-client-gradle-plugin/26312/1 "2018-03-19T22:13:53Z")

</div>

Hi folks,

I created plugin to to help me build client thin jar containing only needed interfaces in addition to regular (full) jar

```gradle
class EjbClientExtension {
  String[] filters = [
      "**/api/*.*",
      " **/api/** /*.*",
  ]
}

class EjbClientPlugin implements Plugin<Project> {
  void apply(final Project project) {
    final EjbClientExtension extension = project.extensions.create("ejbClient", EjbClientExtension)
    project.afterEvaluate {
      project.apply(plugin: "java")
      final Task createEjbClientJarTask = project.task("createEjbClientJar", type: Jar) { task ->
        task.classifier = "client"
        task.from project.sourceSets.main.output

        extension.filters.each {
          task.include it
        }
      }
      project.jar.dependsOn(createEjbClientJarTask)
    }
  }
}

apply plugin: EjbClientPlugin

```

it works fine, but unfortunately it’s not configurable as I expected. What I want is to have possibility to override package need to be included using ejbClient extension, like so:

```gradle
apply plugin: EjbClientPlugin

ejbClient.filters = [
    " **/remote/** /*.*",
    " **/local/** /*.*",
]

```

but as result I still have -client.jar with **/api/** filter, not from ejbClient extension  
How can I fix that?  
Thanks in advice

* * *

Regards,  
Maksim
