Search code examples
javagradlebuild.xmlgradle-task

How to refresh gradle task's targets


I have a project, in which I automate build using gradle. I made a task's target in build.xml file:

<project basedir="." default="build" name="GGP_Base">
  <target name="SimpleServerGameDolar">
    <java classname="banan314.utilities.SimpleGameDolar" failonerror="true" fork="yes">
        <classpath refid="GGP_Base.classpath"/>
    </java>
  </target>
</project>

It worked, I ran it using gradle simpleGameDolar. But then I renamed the java class SimpleGameDolar to SimpleServerGameDolar and changed the classname in the target. And when I run it in the same way, I get the error:

Error: Could not find or load main class banan314.utilities.SimpleGameDolar :simpleGameDolar FAILED

FAILURE: Build failed with an exception.

What can I do to refresh gradle so that it knows that I changed tasks?

I tried gradle clean, gradle build and reopen IntelliJ but neither helped.


Solution

  • Actually, thanks to the comment of @Oliver, I realized that build.xml has completely nothing to do with my gradle build. build.xml is in Ant build. After I changed the right file - build.gradle - it works as I expected. I was even able to delete build.xml.