Closed akberc closed 11 years ago
Although this simplistic maven support was nice to have before we had "aether" I'm wondering if we can't just remove this functionality right now. It's just more stuff to maintain and more stuff that can have bugs, and for what exactly? Opinions? @gavinking @FroMage @tombentley ?
I counted 4-12 downloads on each build/run - once for the typechecker, once for initialization etc.!
Yes, also see: https://github.com/ceylon/ceylon-runtime/issues/45
Aether leaves some temporary files around and has its own little niggles, but we could focus on one and make it really work.
It's just more stuff to maintain and more stuff that can have bugs, and for what exactly?
The less time we spend futzing with Maven the better.
Honestly, given the problems we've seen with maven repos having broken metadata I would say just allocate a single classloader to maven and stick all maven-sourced modules on that one classloader. It's likely to be less-broken than anything else we could possibly do.
Yes, that would work. Then we can say 'Maven repository support is enabled, but dependencies have to be individually defined in module.ceylon
in this format . . .'.
Without some kind of consistent Maven support within modules, it is pretty hard to interop with Java outside the IDE.
Since aether puts its stuff in .m2
, I would go for cached mvn:http
so that the dev knows where to find things, or clear things in one place.
So-called "cached mvn:http" really isn't an option, it's not Maven at all really, you just give a bunch of almost direct URLs to artifacts to download.
And really, Aether works most of the time, we just have this irritating problem that not all Maven artifacts define their dependencies correctly. So to solve that we need a combination of a) a flat classpath like Gavin says and b) a way to override dependencies defined in POMs.
But hopefully most people will never have to deal with that and just adding "--rep aether" will do the trick.
This whole mvn:
thing has always been a stop-gap measure, I'm strongly suggesting we remove it before more people try to use it. There's is only one way forward and that's with Aether.
And that Aether can't use our cache is maybe unfortunate for cleaning the cache, but trying to override that will end up with more problems than it solves.
I also recommend we remove it, but we should improve ease of specifying a non-maven-central maven repo with aether. Without having to define a settings.xml file ;)
@FroMage as in, something in .ceylon/config
?
Great stuff! Roughly, what would aether need to be conffgured to make more use of `~/.ceylon' better?
The end goal is as @quintesse said a few days ago: for a dev to be able to check out a git repo, or unzip a tar ball, together with `.ceylon/config', and voila -- it just works!
Who is going to review this? @quintesse?
After looking at Shrinkwrap and no way of dynamic configuration, there are two options for aether -
.m2
in any case, and if we haven't found a settings.xml, we can create a default ~/.m2/settings.xml
. The down side is that we would need to merge it with Ceylon config etc.aether.xml
in ~./ceylon
and by default populate it with Maven Central. Only keep it in sync with .ceylon/config
aether entries. The up side is that if the user later becomes a Maven fan, we will automatically choose ~/.m2/settings.xml
before the aether.xml
. The aether.xml
would just be a dump of Ceylon config aether lines in settings xml repo format.In the second way, we never prompt the user to enter a settings.xml - just prompt for a default remote Maven repo in case this is the first aether repo being added and no settings.xml
was found -- and pre-populate with Maven Central. With the right defaults and cues, it should be good UI experience and still safe for experienced developers.
I'm pretty sure we already ship a default settings.xml file
we should improve ease of specifying a non-maven-central maven repo with aether. Without having to define a settings.xml file ;)
@FroMage Sorry, the two options were in reference to this comment.
@akberc we should really split this into separate issues I think:
Aah, circles and circles :) Specifically,
.m2
mvn
not caching and going out remotely for every lookup.The use cases we are trying to solve are:
ceylon.net
. Before you say 'the java dependencies for ceylon.net are in Herd', let us agree that they are not all going to be in Herd. Without sending a non-Maven user into a crash course on settings.xml, or trying to understand jar installation through the toolset, we should try to make CMR very transparent.
The only options that come to mind are:
mvn:http
goes out to get a maven artefact and installs the jar in the ceylon repo (caching mvn:http
and really simple to do as import-jar
tool is thereIMHO, I don't think we can be ready for 1.0- without addressing this heads-on.
My test case :) : start a blank CI VM, check out a Ceylon project from that relies on Java and with non-default repos and try to build it. What can the said project put in its .ceylon
folder in order to build without human intervention?
IMO if that user has a corporate Maven Repo they will already have it in their system settings.xml
, they won't have to do anything. If they don't have it they can ask a colleague that uses Maven how they set up their settings.xml
and do the same.
But I agree that being able to easily add an extra Maven repo to the aether lookup would be really nice to have. But I doubt that it will be a big problem if we don't have it before 1.0, there's more than enough artifacts in the standard maven repo and it is possible to use others by adding them to a settings.xml
file (which you can distribute with the project so users downloading it don't have to do anything).
So we can add an extra issue for adding for example a [maven]
section to the Ceylon config file. Where we can put repository=http://.....
items. And we might also extend the aether:
(alias mvn:
) "protocols" with the same thing, for example mvn:http://url.to.remote.site
to add a remote repository.
Yup!
If you can cut out Shrinkwrap, programmatically access aether, use aether-spi
extensions to read ~/.ceylon/config
and write to .ceylon/cache
, and possibly write out module.xml
, you have this nailed.
Shrinkwrap is using aether for a very narrow case and does not provide the flexibility that CMR needs.
No no, let's not do that! Leave Maven alone as it is please! People have set up their Maven environment, have their proper caches, their proxies, their repositories, all neatly set up and then we come along and do it all our way. Not a good idea!
And we only just added Shrinkwrap, so please let's first just focus on 1.0, which is to make sure that things "just work (tm)". If you really want to think about grand refactorings, schedule them for 1.2 ;)
OK, I understand - stability is paramount at this stage.
I solved the immediate problem by figuring out how to bootstrap the excellent https://github.com/loicrouchon/ceylon.build build module and planning a Ceylon custom task to download Maven jars and creating module.xml files -- thereby achieving the goal of a self-contained build with pure Ceylon - no Ant and no Maven in the build.
The timeout and networking issues of CMR remain and exhibit in strange ways. I will update relevant issues on findings.
Thank you for your help and time in discussing this.
Unlike aether, with mvn:http repo, artefacts are stored in `~/.ceylon/cache', which is great, and one place to look - but -
So,
Possibly related to ceylon/ceylon-runtime#45