Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] How to get P2 dependency URL with tycho.

Hi Tobias,

    Thank you for interest in my problem. My little application is not OSGi. Tycho team already do some work for integration OSGi with "the real world of classpath hell". IMHO most effective way is to reuse components, not to create my own. My "resolve" function already download artifacts. I just want to reduce it functionality a bit.
Some people write there own class loaders on second day. But I know that this is not fun for them. Sure that they have a lot of other problems.
    I must to pass URLs to external resolution mechanism. Please just point me to the right chunk of source code in Tycho infrastructure. I may spent a lot of time to read it all page by page.

My thankfulness will be unlimited. Within reasonable limits of course ;-)

Thank you,

2013/5/6 Oberlies, Tobias <tobias.oberlies@xxxxxxx>

Hi Alexey,


I don’t know if writing your own resolver is really the next step you want to do after having done the Hello World example. This is a bit like writing your own class loader on the second day of a Java beginners course… ;-)


So if you are only interested in downloading p2 artifacts to the Maven repository? Why don’t you just trigger a Tycho build to do this for you, and then do whatever you like with the artifacts cached by Tycho?






From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-bounces@xxxxxxxxxxx] On Behalf Of Alexey Aksenov
Sent: Montag, 6. Mai 2013 14:39
To: tycho-dev@xxxxxxxxxxx
Subject: [tycho-dev] How to get P2 dependency URL with tycho.


Hi All.

I read tycho helloworld documentation and write my own resolver. I run maven as embedded library. This way allow to download P2 bundles to .m2 directory :-)
The problem is I don't want to download dependency. I want to know dependency URL!?? Huh!
I resolve P2 dependency with the following simple function (I like Scala, but this is not significant):

def resolve2(maven: Maven, log: Logger) {
    val equinox = maven.lookup(classOf[EquinoxServiceFactory])
    val resolverFactory = equinox.getService(classOf[P2ResolverFactory])
    val targetPlatformBuilder = resolverFactory.createTargetPlatformBuilder(
      new ExecutionEnvironmentConfigurationStub("JavaSE-1.6"))
    targetPlatformBuilder.addP2Repository(new MavenRepositoryLocation("test", new URL("").toURI))
    val targetPlatform = targetPlatformBuilder.buildTargetPlatform()
    val resolver = resolverFactory.createResolver(new MavenLoggerAdapter(maven.plexus.getLogger, true))
    val result = resolver.resolveDependencies(targetPlatform, null)
    System.err.println("!!!" + result)

There is a lot of components involved in the process. So, I need a little hint that point me to the right direction. What is class (or package) responsible for a dependency URL resolution/collection?


tycho-dev mailing list

Back to the top