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 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?

 

Regards

Tobias

 

 

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("http://eclipse.ialto.com/eclipse/updates/4.2/R-4.2.1-201209141800/").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?

Regards,
Alexey


Back to the top