Hello everyone,
I’ve been strugling with resolving classpath entries from an eclipse project.
I was just messing around to see if I could obtain project dependencies and pass them through to an external buildfile, which would build the actual project. as everything works fine as long as you use absolute path’s for eveything (e.g. projects, libraries, containers etc.) it surely doesnt when using the classpathEntries from the eclipse classpath.
for example, you can’t create a project instance like :
Project("/[projectname]")
so I needed another solution wich I thought I found.
https://discuss.gradle.org/t/how-to-read-the-dependencies-from-an-eclipse-classpath?source_topic_id=11940
Though the last post adress exactually the crash I got as well. I run the script with --stacktrace and these are the results:
[exec] Caused by: java.lang.NullPointerException: Cannot invoke method fromJarURI() on null object
[exec] at org.gradle.plugins.ide.eclipse.model.AbstractLibrary.(AbstractLibrary.groovy:38)
[exec] at org.gradle.plugins.ide.eclipse.model.Library.(Library.groovy:22)
[exec] at org.gradle.plugins.ide.eclipse.model.Classpath$_load_closure1.doCall(Classpath.groovy:54)
[exec] at org.gradle.plugins.ide.eclipse.model.Classpath.load(Classpath.groovy:43)
[exec] at org.gradle.plugins.ide.internal.generator.XmlPersistableConfigurationObject.load(XmlPersistableConfigurationObject.groovy:39)
[exec] at org.gradle.plugins.ide.internal.generator.XmlPersistableConfigurationObject$load.callCurrent(Unknown Source)
[exec] at org.gradle.plugins.ide.internal.generator.AbstractPersistableConfigurationObject.load(AbstractPersistableConfigurationObject.groovy:27)
[exec] at org.gradle.plugins.ide.internal.generator.generator.PersistableConfigurationObject$load.call(Unknown Source)
[exec] at build_53ki1eacnsnj8o2cd4lm2euvc$_run_closure2.doCall([location that points to the cp.load() method])
[exec] at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:554)
[exec] at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:535)
[exec] at org.gradle.api.internal.tasks.TaskMutator$1.execute(TaskMutator.java:77)
[exec] at org.gradle.api.internal.tasks.TaskMutator$1.execute(TaskMutator.java:73)
[exec] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
[exec] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
[exec] ... 57 more
So aparently it isn’t able to resolve ‘lib’ dependencies (.zip/.jar files). because when I remove every jar/zip file from the classpath, it works fine.
So my question is: what is going wrong here, and how can I encounter this?
thanks for your time!