# Multi application project with custom tasks/plugins written in Java

**URL:** <https://discuss.gradle.org/t/multi-application-project-with-custom-tasks-plugins-written-in-java/39026>\
**Category:** Help/Discuss\
**Created:** [February 12, 2021, 1:39pm UTC](https://discuss.gradle.org/t/multi-application-project-with-custom-tasks-plugins-written-in-java/39026 "2021-02-12T13:39:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swas](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Swas](https://discuss.gradle.org/u/Swas)\
**Post date:** [February 12, 2021, 1:39pm UTC](https://discuss.gradle.org/t/multi-application-project-with-custom-tasks-plugins-written-in-java/39026/1 "2021-02-12T13:39:29Z")

</div>

Hello,

I’m trying to structure my project as a multi application project. I’d like to mention that I’m really new to gradle and still have some problems grasping some of the concepts. So please correct me if I’m wrong.

I’ve used `gradle init` to create the project structure according the getting started guide [Creating Multi-project Builds](https://docs.gradle.org/current/samples/sample_building_java_applications_multi_project.html)

If I understand it correctly the folder `buildSrc` is basically an own Gradle project (because it has a build.gradle(.kts) file). The build.gradle file has `kotlin-dsl` plugin loaded and defines the `gradlePluginPortal()` repository. The init process also created the folder `src/main/kotlin` where conventions are defined. The way I understand this is that I basically could create Kotlin code in this folder to create plugins and they’ll be loaded automatically in the main build.

But what I’d like to do is instead of using Kotlin to define those Plugins with Java. Which as far as i know is possible. I’ve already found some examples in the Gradle Docs like [Authoring Tasks (gradle.org)](https://docs.gradle.org/current/userguide/more_about_tasks.html#more_about_tasks).

So I’ve copy pasted the example to the exact path. And tried to run it but I’m getting the error that the task is not found.

I don’t know what to look for and where to read about that. I’m already reading the entire documentation but somehow I’m missing something.

I’ll appreciate your feedback and comments.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Chris\_Dore](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/chris_dore/32/7592_2.png) [@Chris\_Dore](https://discuss.gradle.org/u/Chris_Dore)\
**Post date:** [February 14, 2021, 7:32am UTC](https://discuss.gradle.org/t/multi-application-project-with-custom-tasks-plugins-written-in-java/39026/2 "2021-02-14T07:32:00Z")

</div>

Could you share your project or prototypes on something like Github? I think seeing what you have will make it a lot easier to diagnose.

---

<div class="post-metadata">

**Author:** ![Swas](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Swas](https://discuss.gradle.org/u/Swas)\
**Post date:** [February 17, 2021, 11:43am UTC](https://discuss.gradle.org/t/multi-application-project-with-custom-tasks-plugins-written-in-java/39026/3 "2021-02-17T11:43:39Z")

</div>

Hey,  
thanks for replying and sorry for my late reply.  
I’ve got a really busy schedule right now but I’ll prepare something and post it here.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [February 17, 2021, 11:51am UTC](https://discuss.gradle.org/t/multi-application-project-with-custom-tasks-plugins-written-in-java/39026/4 "2021-02-17T11:51:02Z")

</div>

> [@Swas](#):
>
> If I understand it correctly the folder `buildSrc` is basically an own Gradle project (because it has a build.gradle(.kts) file).

Not only an own project, a complete own multi-project build.

> [@Swas](#):
>
> and they’ll be loaded automatically in the main build.

They are automatically added to the class path of the main build scripts, but you still have to apply the plugins you want to apply where you want them applied.

> [@Swas](#):
>
> But what I’d like to do is instead of using Kotlin to define those Plugins with Java. Which as far as i know is possible.

Yes, this is possible.

> [@Swas](#):
>
> And tried to run it but I’m getting the error that the task is not found.

I think what you miss is, that you still have to apply the plugin you write. 🙂
