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

Example of using plugin with micronaut-data #9

Open
zsiegel opened this issue Nov 17, 2021 · 2 comments
Open

Example of using plugin with micronaut-data #9

zsiegel opened this issue Nov 17, 2021 · 2 comments

Comments

@zsiegel
Copy link

zsiegel commented Nov 17, 2021

Hey

I was hoping you might be able to point me in the right direction of how to use this plugin with micronuat-data.

I have a small sample project and I am trying to pull a fork I have created to fix a bug into a local sample project.

Fork with PR fix - https://github.com/zsiegel/micronaut-data/tree/r2dbc-fix-postgres-uuid

My settings.gradle.kts has the following.

import me.champeau.gradle.igp.gitRepositories

rootProject.name = "testing-git"

plugins {
    id("me.champeau.includegit") version "0.1.2"
}

gitRepositories {
    include("micronaut-data") {
        uri.set("[email protected]:zsiegel/micronaut-data.git")
        branch.set("r2dbc-fix-postgres-uuid")
        authentication {
            sshWithPublicKey {
                privateKey.set(file("PATH TO MY KEY"))
            }
        }
    }
}

and then I am trying to just pull in a single dependency into the project to ensure I can download the dep. In build.gradle.kts I have the following...

    implementation("io.micronaut.data:micronaut-data-r2dbc:3.1.3-SNAPSHOT")

I always seem to get a private key error even though I have tripled checked the path to my public key and confirmed I am using it to communicate with GitHub. I have also tried locally cloning and using the local checkout method. The strange thing is if I comment OUT the authentication {} block above the build seems to be stuck on that error forever.

* What went wrong:
Unable to clone repository contents: [email protected]:zsiegel/micronaut-data.git: invalid privatekey: [B@4c57fd8a
> [email protected]:zsiegel/micronaut-data.git: invalid privatekey: [B@4c57fd8a

Any ideas? Thanks for this plugin very excited for it to help me get more involved in the Micronaut community,

@zsiegel
Copy link
Author

zsiegel commented Nov 17, 2021

Actually I made it a little further by tweaking the dependency import.

    implementation(":micronaut-data:data-r2dbc:3.1.3-SNAPSHOT")

So project is now importing but I get an issue with the documentation plugin.

      > No matching configuration of project :zsiegel-micronaut-data was found. The consumer was configured to find an API of a library compatible with Java 11, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Configuration 'documentation':
              - Other compatible attributes:
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 11)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
                  - Doesn't say anything about its usage (required an API)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')

Then if I disable the internal docs plugin I end up seemingly at a dead end...

      > No matching configuration of project :zsiegel-micronaut-data was found. The consumer was configured to find an API of a library compatible with Java 11, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - None of the consumable configurations have attributes.

@melix
Copy link
Owner

melix commented Nov 26, 2021

I think the problem is that Micronaut has project names which do not match the project GAV coordinates.

Can you try with:

gitRepositories {
    include("micronaut-data") {
        uri.set("[email protected]:zsiegel/micronaut-data.git")
        branch.set("r2dbc-fix-postgres-uuid")
        authentication {
            sshWithPublicKey {
                privateKey.set(file("PATH TO MY KEY"))
            }
        }
        includedBuild {
            dependencySubstitution {
                substitute(module("io.micronaut.data:micronaut-data-r2dbc")).using(project(":data-r2dbc"))
            }
        }
    }
}

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

2 participants