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

plugin requires kotlin-pluralize which is not in common maven repos #140

Open
NikkyAI opened this issue Feb 1, 2020 · 17 comments
Open

plugin requires kotlin-pluralize which is not in common maven repos #140

NikkyAI opened this issue Feb 1, 2020 · 17 comments

Comments

@NikkyAI
Copy link

NikkyAI commented Feb 1, 2020

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. add plugin to project
  2. refresh gradle
A problem occurred configuring project ':backend'.
> Could not resolve all artifacts for configuration ':backend:classpath'.
   > Could not find com.github.cesarferreira:kotlin-pluralizer:0.2.9.

this repo seems to be required to add in pluginManagement to find the kotlin-pluralizer dependency
https://repository.mulesoft.org/nexus/content/repositories/public/

it is the only repo i found that provides the dependency
https://mvnrepository.com/artifact/com.github.cesarferreira/kotlin-pluralizer/0.2.9

Expected behavior
A clear and concise description of what you expected to happen.

easier adding of gradle plugin, maybe via shadowing the library ?

Environment:

  • OS: linux
  • Database: PostgreSQL
  • JDK/JREOpen JDK 8
  • Version 1.1.24

Additional context
Add any other context about the problem here.

The harmonica depndency seems to also not be properly uploaded to maven
a .pom file seems to be missing and gradle refuses to find it on jcenter or bintray

Thank you for your cooperation!

@LookBad
Copy link

LookBad commented Feb 26, 2020

I have the same problem.

@KenjiOhtsuka
Copy link
Owner

KenjiOhtsuka commented Mar 1, 2020

@NikkyAI @LookBad
Excuse me, could you share your build.gradle?

It could be the same situation as #144 🤔

@LookBad
Copy link

LookBad commented Mar 1, 2020

Yeah, no problem. I also use kotlin dsl. Gradle version: 6.1.1.

plugins {
    // Support for Kotlin
    id("org.jetbrains.kotlin.jvm") version "1.3.61"
    // Support for building a CLI application
    application
    // Documentation
    id("org.jetbrains.dokka") version "0.10.0"

    id("com.improve_future.harmonica") version "1.1.24"
}

application {
    mainClassName = "com.easythings.parkkometr.AppKt"
    group = "com.easythings"
    version = "0.0.1"
}

sourceSets {
    main {
        java.srcDir("app/main/src")
        resources.srcDir("app/main/resources")
    }
    test {
        java.srcDir("app/test/src/")
        resources.srcDir("app/test/resources/")
    }
}

repositories {
    jcenter()
    maven { url = uri("https://kotlin.bintray.com/ktor") }
}

dependencies {
    val ktorVersion: String by project
    val logbackVersion: String by project
    val exposedVersion: String by project
    val pgVersion: String by project
    val spekVersion: String by project

    // Kotlin ==========================================================================================================
    implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

    // Libs ============================================================================================================
    // Ktor - framework
    implementation("io.ktor", "ktor-server-jetty", ktorVersion)
    implementation("io.ktor", "ktor-server-core", ktorVersion)
    implementation("io.ktor", "ktor-server-host-common", ktorVersion)
    implementation("io.ktor", "ktor-auth", ktorVersion)
    implementation("io.ktor", "ktor-auth-jwt", ktorVersion)
    implementation("io.ktor", "ktor-gson", ktorVersion)
    implementation("io.ktor", "ktor-network-tls-certificates", ktorVersion)

    // Logback - application logger
    implementation("ch.qos.logback", "logback-classic", logbackVersion)

    // Exposed - orm
    implementation("org.jetbrains.exposed", "exposed-core", exposedVersion)
    implementation("org.jetbrains.exposed", "exposed-dao", exposedVersion)
    implementation("org.jetbrains.exposed", "exposed-jdbc", exposedVersion)
    implementation("org.jetbrains.exposed", "exposed-jodatime", exposedVersion)

    // Postgresql - database driver
    implementation("org.postgresql", "postgresql", pgVersion)

    // Tests ===========================================================================================================
    testImplementation("org.jetbrains.kotlin", "kotlin-test")
    testImplementation("org.jetbrains.kotlin", "kotlin-test-junit")

    // Ktor test lib - default
    testImplementation("io.ktor", "ktor-server-tests", ktorVersion)

    // Speak - test lib
    testImplementation("org.spekframework.spek2", "spek-dsl-jvm", spekVersion)
    testRuntimeOnly("org.spekframework.spek2", "spek-runner-junit5", spekVersion)

    // Speak requires kotlin-reflect, can be omitted if already in the classpath
    testRuntimeOnly("org.jetbrains.kotlin", "kotlin-reflect")

    // AssertJ - more readable assertion methods
    testImplementation ("org.assertj","assertj-core","3.15.0")
}

tasks {
    dokka {
        outputDirectory = "$buildDir/docs/dokka"
        outputFormat = "html"
    }

    test {
        useJUnitPlatform {
            includeEngines("spek2")
        }
    }
}

@LookBad
Copy link

LookBad commented Mar 2, 2020

I upgraded Gradle to version 6.2.1. My error msg:

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.github.cesarferreira:kotlin-pluralizer:0.2.9.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/com/github/cesarferreira/kotlin-pluralizer/0.2.9/kotlin-pluralizer-0.2.9.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.improve_future.harmonica:com.improve_future.harmonica.gradle.plugin:1.1.24 > gradle.plugin.com.improve_future:harmonica:1.1.24

@gdude2002
Copy link

We're also having this issue - the repo contains a pom-default.xml, but indeed, that is not where a pom should be, and therefore Gradle is unable to resolve it.

@KenjiOhtsuka
Copy link
Owner

@gdude2002
Hello. Thank you for your comment.
You mean that I have to rename pom-default.xml to pom.xml, right?

@KenjiOhtsuka
Copy link
Owner

I added harmonica-1.1.26.pom

@KenjiOhtsuka
Copy link
Owner

Or, I have to use any other library for pluralization 🤔

@KenjiOhtsuka
Copy link
Owner

KenjiOhtsuka commented Jun 16, 2020

org.jboss.dna.common.text.Inflector looks another option
https://github.com/HexarA/Json2Pojo/blob/master/src/org/jboss/dna/common/text/Inflector.java

It is in Apache 2 licence.
(Should I copy it to this repo or use it as library ....)

@gdude2002
Copy link

gdude2002 commented Jun 16, 2020

I'm not really even sure how you ended up managing to deploy without a pom - it's very much the standard thing, and it's what the maven-publish plugin does by default.

Are you sure you haven't over-customized the deploy phase?

Also: Please do not bundle libraries. They should be Maven dependencies if possible.

@NikkyAI
Copy link
Author

NikkyAI commented Jun 16, 2020

if kotlin-pluralize is only used internally and not exposed to the library user then i guess shadowJar + repackaging is a option
since i could not get this to work i never used it so that may as well be a moot point
(hope to evaluate it for future projects still)

kotlin-pluralize looks like a abandoned project anyways

@gdude2002
Copy link

Kotlin-pluralizer seems to be using JitPack (unfortunately, but it's something)

@KenjiOhtsuka
Copy link
Owner

@LookBad @NikkyAI
adding maven { setUrl("https://jitpack.io") } could be the makeshift solution, I think.

// build.gradle.kts
repositories {
    jcenter()
    maven { setUrl("https://jitpack.io") }
}

@LookBad
Copy link

LookBad commented Jun 23, 2020

It doesn't work for me :(

@KenjiOhtsuka
Copy link
Owner

@LookBad
Excuse me, did you use version 1.1.26?

@LookBad
Copy link

LookBad commented Jun 24, 2020

Version of plugin: 1.1.24, version of lib: 1.1.26.

@KenjiOhtsuka
Copy link
Owner

@LookBad

Sorry to be too late reply. I guess the following change may work. Could you tell me your Java version? I want to test it.

// add
buildscript {
    repositories {
        jcenter()
        maven { url = uri("https://jitpack.io") }
    }
    dependencies {
        classpath group: 'org.jetbrains.kotlin', name: 'kotlin-script-util', version: '1.3.20'
        classpath 'com.improve_future:harmonica:1.1.26'
    }
}

plugins {
    ...
    // remove
    //id("com.improve_future.harmonica") version "1.1.24"
}

// add
apply plugin: 'jarmonica'

repositories {
    jcenter()
    maven { url = uri("https://kotlin.bintray.com/ktor") }
    // add
    maven { url = uri("https://jitpack.io") }
}

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

4 participants