DAG of task dependencides

When I run gradle

experiments\java\edu>gradle

Task :compileJava
<Unknown> [warning] Found @DeclareAnnotation while current release does not support it (see 'org.aspectj.weaver.bcel.AtAjAttributes')


1 warning

 Task :compileTestJava
F:\nag\DWork\osource\experiments\java\edu\build\classes\java\test!com\tejasoft\tests\ju\utils\scan\aop\AbstCallAspect.class [warning] advice defined in com.tejasoft.tests.ju.utils.scan.aop.AbstCallAspect has not been applied [Xlint:adviceDidNotMatch]


1 warning
<======-------> 52% EXECUTING [11s]
 :shadowJar

I see shadowJar should not called… is there a simpler command that dry runs and gives me what tasks depends on what task for easy debug… simpler to graphical or text-based DAG viewer

Why do you think it should not be called?
The build you execute defines which task is executed if you don’t specify one.
By default it displays the help.
But if the build defines one or more tasks as default tasks, those are run.

If you run with --dry-run you see the list of tasks that would get executed.
You don’t see the dependencies between the tasks, but you can get a rough feeling on the dependencies, as dependencies are of course higher in the list.
But it is of course still a list, not a graph that is displayed.

Btw. please stop using quote formatting (> in front of each line) when you actually should use code formatting (three backticks and optionally a format, followed by a newline before and three backticks after), that greatly reduces readability. :slight_smile: You can see the better result in your post, as I adjusted it.

1 Like

Thank You for reformating it.

In the below script runJMeter depends on ‘testClasses’, however, runJMeter is run at last after tests are run…that way, I am not sure why shadowJar is called before test task.

test does not depend on shadowJar and also has no ordering constraint defined, so the order in which they run is not guaranteed.

Did not understand…

Did not understand…

… what?

what is an ordering constraint and how to give one…

Those are for example mustRunAfter and shouldRunAfter. But usually they should not be used if not necessary.
What would be the reasoning to run test after shadowJar if test does not use the shadowJar output?
The ordering constraints are for example helpful if you have test as unit test task and integTest as integration test task and want to run test before integTest as it gives feedback faster.
If indeed test depends on the output of shadowJar but shadowJar is not run first, this is more a sign of broken configuration, where this dependency is not modeled properly.

1 Like

showJar is packaging that makes sense only after all the tests are unsuccessful… in our case, we want to move to performance testing with JMeter only after tests pass, JMeter needs all the last jar to be deployed in its library.

But still, you really shouldn’t care whether shadowJar is built before or after test or maybe at the same time if you for example use configuration cache where all tasks can run in parallel if there is no dependency or ordering constraint between them…