Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mkornipati opened this issue Jan 8, 2016 · 2 comments

Comments

@mkornipati
Copy link

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.

@rspieldenner
Copy link
Contributor

if you save the lock you don't need to -PdependencyLock.useGeneratedGlobalLock=true by default we look in the project directory, the useGenerated flags tell us to look in the build directory

@jotel
Copy link

jotel commented Jan 24, 2017

The fix is provided in this PR: #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants