You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/10/29 20:51:00 UTC

[jira] [Commented] (GROOVY-7080) Cycle in Eclipse

    [ https://issues.apache.org/jira/browse/GROOVY-7080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436167#comment-17436167 ] 

Eric Milles commented on GROOVY-7080:
-------------------------------------

As noted, the references exist between the main and test scopes of various projects.  This should be a supported configuration and has been communicated to the JDT team here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=551129

In order to break the cycles, you can run "gradlew cleanEclipse" then add this to the file {{user.gradle}} in the root of the project, run "gradlew eclipse" and then remove the file.

{code}
// break cycles between projects

configurations.testImplementation.dependencies.removeAll { it.name =~ 'groovy-' }
configurations.testFixturesImplementation.dependencies.removeAll { it.name =~ 'groovy-' }

ext {
    groovyVersion = '4.0.0-beta-1'
}

dependencies {
    testImplementation "org.apache.groovy:groovy-ant:$groovyVersion", {
        exclude group: 'org.apache.groovy', module: 'groovy'
    }
    testImplementation "org.apache.groovy:groovy-dateutil:$groovyVersion", {
        exclude group: 'org.apache.groovy', module: 'groovy'
    }
    testImplementation "org.apache.groovy:groovy-macro:$groovyVersion", {
        exclude group: 'org.apache.groovy', module: 'groovy'
    }
    testImplementation "org.apache.groovy:groovy-test:$groovyVersion", {
        exclude group: 'org.apache.groovy', module: 'groovy'
    }
    testImplementation "org.apache.groovy:groovy-xml:$groovyVersion", {
        exclude group: 'org.apache.groovy', module: 'groovy'
    }
}

// not needed if configurations.*.dependencies.removeAll works
/*eclipse.classpath.file.whenMerged {
    entries.removeAll { entry -> entry.class.simpleName == 'ProjectDependency' }
}*/

allprojects {
    eclipse.classpath.file.whenMerged {
        if (project != rootProject)
            entries.removeAll { entry -> entry.path =~ /\bgroovy-.*\.jar/ } // affects: console, groovydoc, macro, servlet, swing, templates, xml
    }
}
{code}

Once this is done, the .classpath file for the main project has one unresolved entry left (for the main project) that can be removed as well.

> Cycle in Eclipse
> ----------------
>
>                 Key: GROOVY-7080
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7080
>             Project: Groovy
>          Issue Type: Bug
>         Environment: java version "1.7.0_65"
> OpenJDK Runtime Environment (fedora-2.5.1.3.fc20-x86_64 u65-b17)
> Gradle IDE	3.6.1.201408250705-RELEASE
> java version "1.7.0_65"
> OpenJDK Runtime Environment (fedora-2.5.1.3.fc20-x86_64 u65-b17)
>            Reporter: Erwin Mueller
>            Priority: Major
>
> Try to follow guide from https://github.com/groovy/groovy-core#building
> Importing groovy-core and groovy-test gives the error
> A cycle was detected in the build path of project 'groovy'. The cycle consists 
> of projects {groovy, groovy-test}
> Why not just merge groovy-test in groovy-core? The subprojects of Groovy depend on both anyway, and groovy-test is small.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)