# Extending Copy/Sync tasks for plugin

**URL:** <https://discuss.gradle.org/t/extending-copy-sync-tasks-for-plugin/29896>\
**Category:** Help/Discuss\
**Created:** [December 17, 2018, 9:31pm UTC](https://discuss.gradle.org/t/extending-copy-sync-tasks-for-plugin/29896 "2018-12-17T21:31:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwitzel](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/pwitzel/32/7397_2.png) [@pwitzel](https://discuss.gradle.org/u/pwitzel)\
**Post date:** [December 17, 2018, 9:31pm UTC](https://discuss.gradle.org/t/extending-copy-sync-tasks-for-plugin/29896/1 "2018-12-17T21:31:53Z")

</div>

Hello,

I’ve being adventuring in the land of plugins and to take it forward and proper encapsulate the created tasks I want to create classes that extends the Copy/Sync tasks.  
I found little help on that on the documentation and/or on the internet.  
Not being a java guru myself I find a bit difficult to understand what to do with the documentation.

As a test I’ve tried to enhance the class from the tutorial simply by changing `DefaultTask` by `Sync`. The `@TaskAction` notation don’t work anymore, so I tried overloading the `doLast` method, without any luck:

```
class GreetingTask extends Sync {
    String greeting = 'hello from GreetingTask'
    @Override
    public Task doLast(final Action<? super Task> action) {
        action << {println greeting}
        return action
    }
}

```

Obviously I’m doing something really wrong, and the next step would be overriding `configure`, but I fear I’ll find the same challenge.  
So is there a project that does more or less the same thing and I could learn from? Or a reading material that focus on how overload the default tasks methods with new code.

Thanks
