# Gradle doesn't build changes on Aspect class

**URL:** <https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170>\
**Category:** Help/Discuss\
**Tags:** buildship\
**Created:** [March 31, 2017, 8:43am UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170 "2017-03-31T08:43:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![living\_albert](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@living\_albert](https://discuss.gradle.org/u/living_albert)\
**Post date:** [March 31, 2017, 8:43am UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170/1 "2017-03-31T08:43:00Z")

</div>

Hello,

I’ve seen that when I build and deploy to wildfly, if I only modify Aspect class (.aj) it says “UP TO DATE” and doesn’t change the deploy. I have to modify a .java class (adding a commentary or a redundant code) to force it to build and deploy the changes.

Why it is happening and how I could fix it?

I’m using eclipse with buildship.

Thanks.

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [March 31, 2017, 8:57am UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170/2 "2017-03-31T08:57:18Z")

</div>

Hi Albert,

which plugin are you using to compile AspectJ? What is the Gradle version you are using? What tasks are you running and what is the output of the tasks (especially which task is `UP-TO-DATE`).  
It seems to me that the AspectJ classes are not an input to whatever task is saying `UP-TO-DATE`.

Cheers,  
Stefan

---

<div class="post-metadata">

**Author:** ![living\_albert](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@living\_albert](https://discuss.gradle.org/u/living_albert)\
**Post date:** [March 31, 2017, 9:09am UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170/3 "2017-03-31T09:09:22Z")

</div>

Hi Stefan,

I’m using the following plugins:

```
plugins {
id 'java'
id 'war'
id 'eclipse'
}

apply plugin: 'aspectj'

```

This is the gradle version:

```
gradleVersion = '3.3'

```

I only execute the WAR task to generate artifacts.

This is the output:

![](https://global.discourse-cdn.com/gradle/original/2X/4/46907d6758b0cbf113881049d4b8c43c79c61715.png)

Kind regards,  
Albert.

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [March 31, 2017, 11:38am UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170/4 "2017-03-31T11:38:21Z")

</div>

Hi Albert,

I quickly had a look at the `aspectj` plugin from [here](https://github.com/eveoh/gradle-aspectj). Is this the plugin you are using? Note that there is also [this plugin](https://plugins.gradle.org/plugin/aspectj.gradle) which is more recent but I didn’t find documentation or source code for it.  
Anyway, the problem with the `aspectj` plugin seems to be that the task only declares the `.java` files as inputs, see [here](https://github.com/eveoh/gradle-aspectj/blob/master/src/main/groovy/aspectj/AspectJPlugin.groovy#L49). That means that any changes to `.aj` files go unnoticed.  
So this problem would need to be fixed in the plugin. Could you open an issue there?

Cheers,  
Stefan

---

<div class="post-metadata">

**Author:** ![living\_albert](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@living\_albert](https://discuss.gradle.org/u/living_albert)\
**Post date:** [March 31, 2017, 12:02pm UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170/5 "2017-03-31T12:02:12Z")

</div>

Hello Stefan,

I’m using the github aspectJ plugin.  
I’ll try to open an issue there for solve this problem.

Thanks for everything.

Kind regards,  
Albert.

---

<div class="post-metadata">

**Author:** ![living\_albert](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@living\_albert](https://discuss.gradle.org/u/living_albert)\
**Post date:** [April 18, 2017, 9:03am UTC](https://discuss.gradle.org/t/gradle-doesnt-build-changes-on-aspect-class/22170/7 "2017-04-18T09:03:30Z")

</div>

Hello,

The plugin is no longer supported, so this bug can’t be fixed.

What I could do?

Thanks.
