-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
RxJava Maven dependency scope=runtime but is required for compilation #730
Comments
Thanks for the report @patrickconant . This was not an intentional change - I'll have to track down what's causing this - not sure off the top of my head. |
@patrickconant / @axiak Looks like the switch to Nebula publishing broke this piece of the pom. This bug exists in 1.4.0/1.4.1/1.4.2. Also see ReactiveX/RxNetty#292 for another example of this. I've notified the Nebula owners and they have already got this in their list of fixes coming shortly. As soon as that occurs, I'll do a release to pick up that change. Until then, the only workaround is to explicitly depend on all Hystrix dependencies yourself :( For hystrix-core, this should be archauis-core + rxjava + slf4j-api |
Thanks for looking into it.. looks like we're going to ship a shaded version internally :( |
FYI this is what we're using to ship our own corrected version of 1.4.2: https://git.hubteam.com/gist/maxiak/e88ec3c5997d3eabf374 |
FWIW, here's the nebula issue: nebula-plugins/nebula-publishing-plugin#31 |
why would you need to publish your own version? Don't you just need a pom with the right dependencies? That's what we're doing for spring-cloud-netflix. |
@spencergibb it depends on who you're solving for. we have hundreds of projects that depend on hystrix that I'm trying to upgrade to a single new version. |
For others, I got it to work with this Maven configuration: <dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>com.netflix.archaius</groupId>
<artifactId>archaius-core</artifactId>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.0.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.0</version>
</dependency> |
This issue persists in version 1.4.7, fix above still applies |
This issue persists in version 1.4.10. As previously suggested by @juristr excplicitly declare
|
This issue persists in version 1.4.14 |
Hi. Is this issue patched? |
Adding this dependency fixed the build for me
|
This should be fixed with #944 and available in the next release |
I've encountered this issue, but don't know enough about Gradle to help diagnose the issue. In versions of Hystrix prior to 1.4, the Maven dependency on io.reactivex:rxjava had scope=compile (see pom.xml in Maven Central). With version 1.4 and later, the Maven dependency scope is set to "runtime" (pom.xml in Maven Central). This causes Maven-based java compilation failures of projects that depend on Hystrix 1.4 or greater. In my case, the compilation error message is 'cannot access rx.Observable class file for rx.Observable not found'.
It doesn't appear that anything has changed in the hystrix-core/build.gradle file -- the dependency looks right ("compile 'io.reactivex:rxjava:1.0.7'"). But something appears to have changed in how Gradle translates that into the maven pom.xml that's published to Maven Central.
There is a work-around for users running into this issue -- one can simply add a compile-time dependency on rxjava to their own project. That makes using Hystrix a bit more complicated and isn't standard handling for library dependencies.
The text was updated successfully, but these errors were encountered: