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

alpakka-json-streaming cannot be used from Maven as-is #2338

Closed
laszlovandenhoek opened this issue Jun 8, 2020 · 6 comments
Closed

alpakka-json-streaming cannot be used from Maven as-is #2338

laszlovandenhoek opened this issue Jun 8, 2020 · 6 comments

Comments

@laszlovandenhoek
Copy link
Contributor

Versions used

2.0.0

Expected Behavior

Adding akka-stream-alpakka-json-streaming_2.xx as a Maven dependency works out of the box.

Actual Behavior

Given a pom.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.lightbend.akka</groupId>
            <artifactId>akka-stream-alpakka-json-streaming_2.13</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>
</project>

Running mvn verify from the command line yields this error:

[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:0.0.1-SNAPSHOT: Could not find artifact com.github.jsurfer:jsurfer:jar:1.6.0 in nexus

The issue is that there is no JAR, only a POM. However, in the published pom.xml for alpakka-json-streaming, the dependency on com.github.jsurfer:jsurfer:jar:1.6.0 is not qualified as a pom dependency, and thus assumed to be a JAR. It is specified here:

https://github.com/akka/alpakka/blob/master/project/Dependencies.scala#L301

@ennru
Copy link
Member

ennru commented Jun 9, 2020

I'm afraid sbt can not express this correctly.

@ennru
Copy link
Member

ennru commented Jun 9, 2020

Can we depend on the libraries it points to directly?

@laszlovandenhoek
Copy link
Contributor Author

laszlovandenhoek commented Jun 10, 2020

From the looks of it you could do away with the jsurfer dependency and keep only jsurfer-jackson, because the former is the parent of the latter and thus would be pulled in transitively. I'm unsure why the former was included in the first place. Removing the explicit jsurfer dependency and running sbt test locally yielded some test failures, but none related to json streaming. The build succeeded, at least, and that's where you'd expect problems, if at all.

I'll submit a PR.

@laszlovandenhoek
Copy link
Contributor Author

Until the PR is merged and a new version is released, you can work around the problem by excluding the erroneous dependency like so:

<dependency>
    <groupId>com.lightbend.akka</groupId>
    <artifactId>akka-stream-alpakka-json-streaming_2.13</artifactId>
    <version>2.0.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.github.jsurfer</groupId>
            <artifactId>jsurfer</artifactId>
        </exclusion>
    </exclusions>
</dependency>

@ennru ennru added this to the 2.0.2 milestone Jun 11, 2020
@ennru
Copy link
Member

ennru commented Jun 11, 2020

Fixed with #2344, but I'll leave it open for others to find the temporary fix.

@ennru
Copy link
Member

ennru commented Sep 17, 2020

Releasing Alpakka 2.0.2 tomorrow.

@ennru ennru closed this as completed Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants