# Project as annotationProcessor not working properly

**URL:** <https://discuss.gradle.org/t/project-as-annotationprocessor-not-working-properly/41066>\
**Category:** Help/Discuss\
**Created:** [September 27, 2021, 5:09am UTC](https://discuss.gradle.org/t/project-as-annotationprocessor-not-working-properly/41066 "2021-09-27T05:09:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suraj1291993](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@suraj1291993](https://discuss.gradle.org/u/suraj1291993)\
**Post date:** [September 27, 2021, 5:09am UTC](https://discuss.gradle.org/t/project-as-annotationprocessor-not-working-properly/41066/1 "2021-09-27T05:09:50Z")

</div>

I am working on a annotation processor project with multi-module Gradle Build Setup. The annotation processor itself is written as a sub-module (say `processor`). A test module (say `example`) has `annotationProcessor` dependency on the `processor` module.

I have recreated [a sample project](https://github.com/suraj1291993/gradle-annotation-processor-issue.git) to showcase the issue I am facing.

The annotation **processor** module uses **ServiceLoader** in its implementation. When I build the project using `gradle :example:build`, the ServiceLoader can’t discover its implementation of the service provided which causes issue in my code flow.

[![Project build](https://i.stack.imgur.com/TRMgo.png)](https://i.stack.imgur.com/TRMgo.png)

This issue is not occurring when I build the classes directly in Intellij IDEA.

Need help in resolving this issue.

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [September 27, 2021, 6:55am UTC](https://discuss.gradle.org/t/project-as-annotationprocessor-not-working-properly/41066/2 "2021-09-27T06:55:45Z")

</div>

Are you sure you included the correct sample project? I don’t have any issues building the one in the repository provided.

---

<div class="post-metadata">

**Author:** ![suraj1291993](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@suraj1291993](https://discuss.gradle.org/u/suraj1291993)\
**Post date:** [September 27, 2021, 7:15am UTC](https://discuss.gradle.org/t/project-as-annotationprocessor-not-working-properly/41066/3 "2021-09-27T07:15:09Z")

</div>

I gave reference to a wrong project. I have edited the question to point to the [correct repo](https://github.com/suraj1291993/gradle-annotation-processor-issue.git)

---

<div class="post-metadata">

**Author:** ![suraj1291993](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@suraj1291993](https://discuss.gradle.org/u/suraj1291993)\
**Post date:** [October 4, 2021, 8:38am UTC](https://discuss.gradle.org/t/project-as-annotationprocessor-not-working-properly/41066/4 "2021-10-04T08:38:15Z")

</div>

Any help on this would be very much appreciated
