"Плагин с идентификатором 'org.xtext.xtend' не найден."ошибка - PullRequest
0 голосов
/ 03 октября 2018

Я собирал языковой сервер, следуя этому уроку https://www.eclipse.org/community/eclipse_newsletter/2017/may/article5.php

Но, когда я пытался собрать shadowJar, я продолжал получать эту ошибку:

D:\leaf\org.xtext.example.mydsl1.parent>gradle shadowJar

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\leaf\org.xtext.example.mydsl1.parent\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating root project 'org.xtext.example.mydsl1.parent'.
> Plugin with id 'org.xtext.xtend' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

Ниже моя сборка.gradle файл родительского скрипта

buildscript {
    repositories {
        jcenter()
    }
    plugins {
        id "org.xtext.xtend" version "2.0.1"
    }
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }   
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
        classpath "org.xtext:xtext-gradle-plugin:2.0.1"
    }
}

subprojects {
    ext.xtextVersion = '2.16.0-SNAPSHOT'
    repositories {
        jcenter()
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots'
        }
    }

    apply plugin: 'java'
    apply plugin: 'org.xtext.xtend'
    apply plugin: 'com.github.johnrengelman.shadow'
    apply from: "${rootDir}/gradle/source-layout.gradle"
    apply from: "${rootDir}/gradle/maven-deployment.gradle"
    apply plugin: 'eclipse'

    group = 'org.xtext.example.mydsl1'
    version = '1.0.0-SNAPSHOT'

    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'

    configurations.all {
        exclude group: 'asm'
    }
}

1 Ответ

0 голосов
/ 04 октября 2018

Я снова создал проект и использовал код, созданный мастером.Я выбрал тип сборки языкового сервера «Fat jar», так как моей целью было создать его.Кроме того, я добавил базовое имя, классификатор и версию, приведенные в руководстве, к автоматически сгенерированному коду.Shadowjar (в файле build.gradle папки .ide) была единственной частью кода, которую я изменил.Таким образом, мой код shadowjar выглядит следующим образом:

shadowJar {
    baseName = 'dsl-language-server'
    classifier = null
    version = null
    from(project.convention.getPlugin(JavaPluginConvention).sourceSets.main.output)
    configurations = [project.configurations.runtime]
    exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA','schema/*',
        '.options', '.api_description', '*.profile', '*.html', 'about.*', 'about_files/*',
        'plugin.xml', 'modeling32.png', 'systembundle.properties', 'profile.list')
    classifier = 'ls'
    append('plugin.properties')
}

Затем я перешел в родительскую папку своего проекта через Windows PowerShell и собрал ее с помощью команды "gradle shadowjar".Он построен хорошо!Встроенный файл jar находится в каталоге / build / libs / в каталоге .ide.

...