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

Invalid maven build #6

Open
elonzh opened this issue Jan 18, 2022 · 3 comments
Open

Invalid maven build #6

elonzh opened this issue Jan 18, 2022 · 3 comments

Comments

@elonzh
Copy link

elonzh commented Jan 18, 2022

Adding dependency by Gradle:

implementation("org.jfree:org.jfree.skijagraphics2d:1.0.3")

Dependency output:

+--- org.jfree:org.jfree.skijagraphics2d:1.0.3
|    +--- org.jetbrains.skija:skija-${skija.platform}:0.92.22 FAILED
|    +--- org.slf4j:slf4j-api:1.7.32
|    \--- org.apache.logging.log4j:log4j-slf4j-impl:2.14.1
|         +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.32
|         \--- org.apache.logging.log4j:log4j-api:2.14.1

Expect:

org.jetbrains.skija:skija-linux:0.92.22

Error:

> Error while evaluating property 'filteredArgumentsMap' of task ':compileKotlin'
   > Could not resolve all files for configuration ':compileClasspath'.
      > Could not resolve org.jetbrains.skija:skija-${skija.platform}:0.92.22.
        Required by:
            project : > org.jfree:org.jfree.skijagraphics2d:1.0.3
         > Could not resolve org.jetbrains.skija:skija-${skija.platform}:0.92.22.
            > Could not get resource 'https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/skija/skija-$%7Bskija.platform%7D/0.92.22/skija-$%7Bskija.platform%7D-0.92.22.pom'.
               > Could not GET 'https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/skija/skija-$%7Bskija.platform%7D/0.92.22/skija-$%7Bskija.platform%7D-0.92.22.pom'. Received status code 400 from server: Bad Request
         > Could not resolve org.jetbrains.skija:skija-${skija.platform}:0.92.22.
            > Could not get resource 'https://packages.jetbrains.team/maven/p/skija/maven/org/jetbrains/skija/skija-$%7Bskija.platform%7D/0.92.22/skija-$%7Bskija.platform%7D-0.92.22.pom'.
               > Could not GET 'https://packages.jetbrains.team/maven/p/skija/maven/org/jetbrains/skija/skija-$%7Bskija.platform%7D/0.92.22/skija-$%7Bskija.platform%7D-0.92.22.pom'. Received status code 400 from server: Bad Request
@jfree
Copy link
Owner

jfree commented Jan 19, 2022

To be honest I don't know how this should be dealt with - it is the first time I have a Java project that relies on platform specific dependencies. Any ideas?

@hakanai
Copy link

hakanai commented Mar 13, 2022

I had the same issue, but thought it to be more a problem with Gradle not understanding the profiles section of the POM, so I filed a ticket with Gradle.

@hakanai
Copy link

hakanai commented Mar 16, 2022

The workaround I ended up putting into my build to get the dependency to resolve properly:

configurations.all {
    resolutionStrategy.eachDependency {
        // Workaround for https://github.com/gradle/gradle/issues/20164
        if (requested.name == "skija-\${skija.platform}") {
            val os = org.gradle.internal.os.OperatingSystem.current()
            val platform = when {
                os.isWindows -> "windows"
                os.isMacOsX -> "macos"
                os.isLinux -> "linux"
                else -> throw UnsupportedOperationException("Unknown OS: $os")
            }
            useTarget("${requested.group}:skija-$platform:${requested.version}")
        }
    }
}

This would have been before I discovered that it was the wrong skija so I couldn't use it anyway, but it might help someone out.

I'm still trying to figure out how other builds are doing platform-dependent stuff. e.g., when I pull in compose desktop as a dependency, it correctly resolves skiko-awt-runtime-windows-x64 somehow, so there must be some more supported way to do these sorts of variants not just by OS but by architecture.

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