ceylon / ceylon-runtime

DEPRECATED
24 stars 5 forks source link

Transitive Maven dependency not loaded even if added to module.ceylon #45

Closed akberc closed 10 years ago

akberc commented 10 years ago

This may or may not be a bug.

gavinking commented 10 years ago

But does Maven jar A actually declare its dependency to B in its maven metadata?

akberc commented 10 years ago

Yes, they do, and it gets pulled into the cache. I am using mvn:http// repo style and not aether.

The two I've tried are

akberc commented 10 years ago

Will investigate further tonight as it is not consistent. Sometimes, even the load trigger does not find the second jar.

module com.dgwave.lahore.template "0.1" {
    import ceylon.collection "0.6";
    import ceylon.io "0.6";
    import ceylon.test "0.6";

    import java.base "7";
    import org.jruby.joni.joni "2.0.0";
    import org.jruby.jcodings.jcodings "1.0.10";
}

And the code:

shared {String*} segments(String tosplit, String pattern) {
    variable {Character*} pat = pattern.characters;

    if (pattern.startsWith("/")) {
        pat = pat.skipping(1).takingWhile((Character c) => c != '/');
    }

    asciiToUpper(39); // trigger load of module

    Regex r = Regex(String(pat));
FroMage commented 10 years ago

The mvn repos don't support Maven dependencies defined in poms. I think that's your problem. We are not going to support it, but perhaps we should print a warning.

akberc commented 10 years ago

Not using Maven dependencies, the problem is that Ceylon code can access A, and Ceylon code can access B, but A cannot access B, resulting in no possible way to use A.

Possibly separate classloader for each module. I used to be able to trigger a load of B about a month ago, but not any more. But I can still call A and B from Ceylon code separately.

Since most Maven artefacts have dependencies, and with the workaround not working, the 'mvn' repo feature is basically not very useful.

akberc commented 10 years ago

Referencing https://github.com/ceylon/ceylon-runtime/issues/35

FroMage commented 10 years ago

Closing, we are going to remove the mvn repo.

quintesse commented 10 years ago

Not "going to", I already changed it some time ago, it's now an alias for "aether".