Kotlin Plugin Offline use

已回答

I am creating a polyglot project with Kotlin, Java & Groovy. My build.gradle file has the below plugins block.

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.5.10'
    id 'groovy'
    id 'java'
}

When I share this project with a co-worker who is working from with-in corporate network that does not allow internet access, he gets the below error message. I have overcome the maven dependency by including all the necessary jars in a lib folder and using it like this.

repositories {
    flatDir {
        dirs 'lib'
    }
}

However I am not sure how I can also overcome the below error. Is there a way to include the plugin dependency also in a lib folder the same way other maven dependencies are shared?

From the error message it looks like the problems stems from the fact that gradle is trying to reach 'Gradle Central Plugin Repository' which cannot be reached without internet access. Is there any way to resolve this dependency without internet access?

Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.5.10'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)

- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.10')

  Searched in the following repositories:

    Gradle Central Plugin Repository

      at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:223)

评论操作 固定链接

Please check this thread on a Gradle forum on this question: Gradle Plugins Offline Resolution.

1
评论操作 固定链接

Thank you for your reply. I was able to use the suggestions in the referenced post to resolve the issue.

0

请先登录再写评论。