Gradle - clarification on "check.dependsOn dependencyCheckAggregate"

2,198 views
Skip to first unread message

Piyush Mittal

unread,
Jul 28, 2017, 3:23:12 AM7/28/17
to Dependency Check

Run ODC using:
./gradlew dependencyCheckAggregate --info

Error
* What went wrong:
A problem occurred evaluating project 'testGradle'.
Could not find property 'check' on project 'testGradle'

error in this line "check.dependsOn dependencyCheckAggregate"

If above line is removed, everything works fine. Hence, wanted to confirm if this line is required or not. What it does and where exactly to put this line in build.gradle file. Thanks!

Christopher Badalucco

unread,
Jul 28, 2017, 6:38:09 AM7/28/17
to Piyush Mittal, Dependency Check
"check" is a task that is added by the Java plugin.  I haven't read the code to see if ODC truly depends on the check task or if it was just using it as a way to hook in, but perhaps Jeremy can add more clarification.  My assumption is applying the Java plugin would also solve your issue:
--
You received this message because you are subscribed to the Google Groups "Dependency Check" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dependency-che...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeremy Long

unread,
Jul 28, 2017, 11:51:53 PM7/28/17
to Christopher Badalucco, Piyush Mittal, Dependency Check
I suppose I should add a comment clarifying why the `check.dependsOn dependencyCheckAggregate` is in the documentation the way it is.  That is a fairly standard way within gradle to attach the dependencyChecckAggregate task to the Java plugin's check task. If you are not using the java plugin you would either need to explicitly invoke the dependencyCheckAggregate task or attach it to another standard task in your build.

--Jeremy

To unsubscribe from this group and stop receiving emails from it, send an email to dependency-check+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Dependency Check" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dependency-check+unsubscribe@googlegroups.com.

Stefan Neuhaus

unread,
Jul 29, 2017, 11:10:05 AM7/29/17
to Dependency Check, c10...@gmail.com, piyus...@gmail.com
Note that java plugin has to be applied before setting the dependsOn relation, e.g. like this:

apply plugin: 'java'
check
.dependsOn dependencyCheckUpdate

If you do it the other way round, the aforementioned error occurs. Also note that the java plugin gets applied automatically by some other plugins like the groovy plugin.




On Saturday, 29 July 2017 05:51:53 UTC+2, Jeremy Long wrote:
I suppose I should add a comment clarifying why the `check.dependsOn dependencyCheckAggregate` is in the documentation the way it is.  That is a fairly standard way within gradle to attach the dependencyChecckAggregate task to the Java plugin's check task. If you are not using the java plugin you would either need to explicitly invoke the dependencyCheckAggregate task or attach it to another standard task in your build.

--Jeremy
On Fri, Jul 28, 2017 at 6:37 AM, Christopher Badalucco <c10...@gmail.com> wrote:
"check" is a task that is added by the Java plugin.  I haven't read the code to see if ODC truly depends on the check task or if it was just using it as a way to hook in, but perhaps Jeremy can add more clarification.  My assumption is applying the Java plugin would also solve your issue:
On Fri, Jul 28, 2017 at 3:23 AM Piyush Mittal <piyus...@gmail.com> wrote:

Run ODC using:
./gradlew dependencyCheckAggregate --info

Error
* What went wrong:
A problem occurred evaluating project 'testGradle'.
Could not find property 'check' on project 'testGradle'

error in this line "check.dependsOn dependencyCheckAggregate"

If above line is removed, everything works fine. Hence, wanted to confirm if this line is required or not. What it does and where exactly to put this line in build.gradle file. Thanks!

--
You received this message because you are subscribed to the Google Groups "Dependency Check" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dependency-che...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Dependency Check" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dependency-che...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages