Skip to content

"Gradlew -PdependencyLock.useGeneratedGlobalLock=true build" fails with exception #84

@mkornipati

Description

@mkornipati

I am looking for available options for dependency locking and came across this today and looks interesting. I am playing around with this and got into below issue. We got many multiprojects and I applied this plugin to one of my projects on root level and then just tried below steps.

1. gradlew generateGlobalLock

Can see it generated "build\global.lock" with all dependencies I got with locked version.

2. gradlew -PdependencyLock.useGeneratedGlobalLock=true build

failing with below error

Caused by: java.lang.NullPointerException: Cannot get property 'path' on null object
        at nebula.plugin.dependencylock.DependencyLockPlugin.apply(DependencyLockPlugin.groovy:83)
        at nebula.plugin.dependencylock.DependencyLockPlugin.apply(DependencyLockPlugin.groovy)
        at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
        at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:43)
        at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
        ... 61 more

I also tried the same command after "saveGlobalLock" and still the same issue. I am going through the code to understand this better and came across this area of code which seems to be causing it.

if I understand this better, we are creating the "generateGlobalLock" task and then trying to get "getDependenciesLock().path". not sure, if this path will be available. As it looks like this is going to be null?

Please let me know if I am missing anything here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions