Внезапная потеря зависимостей в проекте Eclipse Gradle - PullRequest
0 голосов
/ 26 мая 2018

Я работаю с проектом Gradle в Eclipse Oxygen с Java 8 и оболочкой Gradle 4.6.

Когда я пытался добавить новую зависимость compile 'com.googlecode.json-simple:json-simple:1.1.1' и обновить проект, все «Проект и внешние»Папка "Зависимости" исчезла без следа, что останавливает мой проект, запущенный из Eclipse (хотя он может выполняться через задачу Gradle Run).

Удаление вновь добавленной зависимости не спасает меня.Ни gradlew cleanEclipse & gradlew eclipse, ни обновление проекта бесчисленное количество раз.

Я также попытался очистить кэш и принудительно перестроил проект при повторном импорте, но «Проект и внешние зависимости» не отображаются.

Чтоя должен сделать, чтобы вернуть старые зависимости?

Вот мой build.gradle

// Apply the java plugin to add support for Java
apply plugin: 'java'
// Apply the plugin to be runnable
apply plugin: 'application'
// Apply the eclipse plugin to import project on other machines
apply plugin: 'eclipse'
// JUnit 5
apply plugin: 'org.junit.platform.gradle.plugin'

// Define the entry point
mainClassName = 'meshIneBits.MeshIneBitsMain'
applicationName = 'MeshIneBits'

// In this section you declare where to find the dependencies of your project
repositories {
    // Use 'jcenter' for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

sourceCompatibility = 1.8

// In this section you declare the dependencies for your production and test code
dependencies {
    compile 'org.processing:core:3.3.5'
    compile 'org.jogamp.jogl:jogl-all:2.3.2'
    compile 'org.jogamp.gluegen:gluegen-rt:2.3.2'

    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-amd64"
    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-armv6"
    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-armv6hf"
    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-i586"
    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-macosx-universal"
    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-windows-amd64"
    runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-windows-i586"

    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-amd64"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-armv6"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-armv6hf"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-i586"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-macosx-universal"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-solaris-i586"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-windows-amd64"
    runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-windows-i586"

    testCompile('org.junit.jupiter:junit-jupiter-api:5.1.0',
            'org.junit.jupiter:junit-jupiter-params:5.1.0')
    testRuntime('org.junit.jupiter:junit-jupiter-engine:5.1.0',
            'org.junit.platform:junit-platform-launcher:1.1.0')
}

eclipse {
    project.natures 'org.eclipse.buildship.core.gradleprojectnature'
    classpath {
        file {
            defaultOutputDir = file('bin/main')
            whenMerged {
                //change output folder for tests
                def testsrc = entries.find { it.path == 'src/test/java' }
                testsrc.output = "bin/test"

                def testres = entries.find { it.path == 'src/test/resources' }
                testres.output = "bin/test"

                // Remove local ref for libs
                entries.removeAll{ it.kind == "lib" }
            }
            containers 'org.eclipse.jdt.junit.JUNIT_CONTAINER/5', 'org.eclipse.buildship.core.gradleclasspathcontainer' }
    }
}

buildscript {
    repositories { mavenCentral() }
    dependencies { classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0' }
}

jar {
    baseName = applicationName
    version = '0.2.0'
    manifest { attributes  'Main-Class' : mainClassName }
}

Редактировать: После переключения на IntelliJ проблема решена (я использовал ту же папку проекта).Так что я думаю, что это проблема в Eclipse.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...