BreadMoirai / github-release-gradle-plugin

A Gradle Plugin to send Releases to Github
Apache License 2.0
108 stars 26 forks source link

extra dependencies needed in project #11

Closed bergvandenp closed 5 years ago

bergvandenp commented 5 years ago

To get the plugin working, I need to add some dependencies in my project. That shouldn't be needed, but if I don't, I get classNotFound errors. What am I doing wrong?

classpath 'com.squareup.okhttp3:okhttp:3.12.0'
classpath 'com.j256.simplemagic:simplemagic:1.10'
classpath 'org.zeroturnaround:zt-exec:1.10'
BreadMoirai commented 5 years ago

I might be able to help you better if you upload your gradle build file. This plugin shouldn't require you to add any dependencies yourself.

BreadMoirai commented 5 years ago

You may need to add an extra snippet to the top of your build.gradle file

buildscript {
  repositories {
    jcenter()
  }
}
bergvandenp commented 5 years ago

thanks for the suggestion, but that doesn't work. This is the same issue as #9 I think it's caused by the way the dependecies are decleared (implementation). https://docs.gradle.org/current/userguide/managing_transitive_dependencies.html

stewartbryson commented 5 years ago

You may need to add an extra snippet to the top of your build.gradle file

buildscript {
  repositories {
    jcenter()
  }
}

Gradle does this be default... using jCenter to resolve dependencies.

I'm having issues resolving OkHttpClient, and the buildscript recommendation does not help. Any ideas?

java.lang.NoClassDefFoundError: okhttp3/OkHttpClient

stewartbryson commented 5 years ago

thanks for the suggestion, but that doesn't work. This is the same issue as #9 I think it's caused by the way the dependecies are decleared (implementation). https://docs.gradle.org/current/userguide/managing_transitive_dependencies.html

I'm not sure about the change to api and implementation... I still use compile for most everything. I have tested using implementation with Gradle plugins and I see this issue. So I believe a simple compile would fix this. However... I'm not sure what the preferred approach is. Should it be api to create the transitive dependencies?

Regardless... I added this to my build script and it corrected it:

buildscript {
   dependencies {
      classpath 'com.squareup.okhttp3:okhttp:3.12.0'
      classpath 'com.j256.simplemagic:simplemagic:1.10'
      classpath 'org.zeroturnaround:zt-exec:1.10'
   }
}

Again... using compile in all my plugins, I never have to do this when the libs are on jCenter.

kevinmmarlow commented 5 years ago

Having the same problem. Not sure why the dependencies are not downloading from jcenter.

duncte123 commented 5 years ago

I'm having the same issue with gradle 5.1.1 and gradle 4.10.3 on version 2.2.3 on java 11

BreadMoirai commented 5 years ago

As per stewartbryson's recommendation, I have updated 2.2.4 to use compile instead of implementation