Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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?


Back to the top