简体   繁体   中英

Error compiling Ceylon example with Gradle

Ceylon 1.3.1 has just been released, one of the new items is better integration with Java projects/libraries. Decided to take one of the samples for a spin ( https://github.com/DiegoCoronel/ceylon-spring-boot ) alongside the ceylon-gradle plugin ( https://github.com/renatoathaydes/ceylon-gradle-plugin ).

As far as I can tell, turning this project into a multi-project Gradle build is a matter of adding two files with the following configuration.

settings.gradle

include 'gateway'
include 'discovery'
include 'foo'
include 'bar'
include 'foobar'

build.gradle

plugins {
    id 'com.athaydes.ceylon' version '1.3.0' apply false
}

subprojects { subprj ->
    subprj.apply plugin: 'com.athaydes.ceylon'

    repositories {
        mavenCentral()
    }

    ceylon {
        module = subprj.name
    }
}

Unfortunately building any of the modules results in errors, such as

$ gradle :gateway:compileCeylon

:gateway:resolveCeylonDependencies
:gateway:createDependenciesPoms
:gateway:createMavenRepo
:gateway:generateOverridesFile
:gateway:createModuleDescriptors
:gateway:importJars
:gateway:compileCeylon
source/gateway/module.ceylon:3: error: Pre-resolving of module failed: Could not find module: antlr/2.7.7
        import ceylon.interop.java "1.3.0";
        ^
ceylon compile: There was 1 error
:gateway:compileCeylon FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gateway:compileCeylon'.
> Ceylon process exited with code 1. See output for details.

This happens using Gradle 3.2

------------------------------------------------------------
Gradle 3.2
------------------------------------------------------------

Build time:   2016-11-14 12:32:59 UTC
Revision:     5d11ba7bc3d79aa2fbe7c30a022766f4532bbe0f

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_112 (Oracle Corporation 25.112-b16)
OS:           Mac OS X 10.10.5 x86_64

Tried setting additional properties on the ceylon configuration as explained in the plugin's documentation, such as

ceylon {
    flatClasspath = false
    importJars = true
    forceImports = true
}

However the error persists. Any pointers on what I may be missing would be greatly appreciated.

This is because ceylon gradle plugin does not support yet the new feature --fully-export-maven-dependencies ... I created the issue now ;), so to make your project work you probably need to change each subproject/.ceylon/config with these options:

[compiler]
source=source
resource=resource

[defaults]
encoding=UTF-8
overrides=build/overrides.xml
flatclasspath=true
fullyexportmavendependencies=false

It will disable the new ceylon feature and uses ceylon gradle plugin feature and the generated overrides.xml file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM