snyk / snyk-gradle-plugin

Basic Snyk CLI plugin for Gradle support
Other
25 stars 19 forks source link

Please use complete sub project path instead of name to check for onlyProj #195

Closed Larusso closed 11 months ago

Larusso commented 2 years ago

https://github.com/snyk/snyk-gradle-plugin/blob/9989b21137695bedc5182f551e6d3299e6eebb23/lib/init.gradle#L248

Gradle multiproject setup can be nested. One can setup the following structure:

settings.gradle
build.gradle
sub1/foo/build.gradle
sub2/foo/build.gradle

The settings.gradle could look like this:

rootProjectName="myProject"
include ':sub1:foo'
include ':sub2:foo'

So here we have four subprojects!

When declaring the --sub-project one has to pass the sub project name without the path (eg --sub-project=foo). It would be cleaner and actually more correct to use the full project path --sub-project=:sub1:foo. Gradle exposes this in the Project class.

Projects are arranged into a hierarchy of projects. A project has a name, and a fully qualified path which uniquely identifies it in the hierarchy.

see: https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getPath--

snyksec commented 9 months ago

:tada: This issue has been resolved in version 4.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: