| Summary: | Using -destination flag, get p2.core.ProvisionException: Need to set the destination artifact repository location. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Nick Boldt <nboldt> | ||||||
| Component: | p2 | Assignee: | P2 Inbox <equinox.p2-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | aniefer, pascal | ||||||
| Version: | 3.5 | Flags: | dj.houghton:
review+
pascal: review+ john.arthorne: review+ |
||||||
| Target Milestone: | 3.5 RC3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
The class that implements the task is org.eclipse.equinox.p2.internal.repository.tools.tasks.Repo2RunnableTask However, regardless of that, this task will not work outside of an OSGi environment. It uses a p2 engine operation, repositories are managed both through OSGi services and through the plugin registry. For this to work outside of OSGi you are essentially asking for most of the core of p2 to work outside of OSGi. Fair enough. So is there a way to run it headless? If I do this: ./eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable I get this: org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: Need to set the destination artifact repository location. What's the syntax for specifying <repository> and <source> on the commandline? There are "-source" and "-destination" arguments. You should be able to specify multiple -source repos. The -destination should get used for both metadata and artifacts. None of these work, whether the destination dir exists or not: /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source file://tmp/GEF-Update-3.4.2.zip -destination /tmp/tmp-unpacked /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source file://tmp/GEF-Update-3.4.2.zip -destination file:/tmp/tmp-unpacked /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source file://tmp/GEF-Update-3.4.2.zip -destination file://tmp/tmp-unpacked file://tmp/GEF-Update-3.4.2.zip is not a proper repo URL. For a zip you will need something more like "jar:file:/tmp/GEF-Update-3.4.2.zip!/" (assuming there is no "eclipse" folder in the root of the zip). (In reply to comment #5) > file://tmp/GEF-Update-3.4.2.zip is not a proper repo URL. For a zip you will > need something more like "jar:file:/tmp/GEF-Update-3.4.2.zip!/" (assuming > there is no "eclipse" folder in the root of the zip). Nope. $ /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source jar:file:/tmp/GEF-Update-3.4.2.zip/home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -ll -destination file:/tmp/tmp-unpacked yields: org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: Malformed reference to remote file: jar:file:/tmp/GEF-Update-3.4.2.zip/home/nboldt/eclipse/eclipse/eclipse/content.xml Caused by: java.lang.NullPointerException: no !/ in spec org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: Need to set the destination artifact repository location. Correction. The ! works if you escape it: /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source jar:file:/tmp/GEF-Update-3.4.2.zip\!/ -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -destination file://tmp/tmp-unpacked but I still get: org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: Need to set the destination artifact repository location. Wouldn't it be awesome if the error message actually told you HOW to fix the problem, rather than just WHAT the problem was? Contrast: "Need to set the destination artifact repository location." with "Need to set -destination file:/path/to/artifact/repository" I'm just sayin'. :) Sorry, closed based on the last email I read, not on the actual comments. :-) The wiki page above lists some of the args. (In reply to comment #9) > Sorry, closed based on the last email I read, not on the actual comments. :-) > The wiki page above lists some of the args. Yes, but ant params != commandline flags. But, just to prove I'm willing to give the benefit of the doubt, I've tried a couple more attempts, this time using -repository (since that's what's in the wiki'd task examples): $ /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source jar:file:/tmp/GEF-Update-3.4.2.zip\!/ -repository file://tmp/tmp-unpacked $ /home/nboldt/eclipse/eclipse/eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.repository.repo2runnable -source jar:file:/tmp/GEF-Update-3.4.2.zip\!/ -repository /tmp/tmp-unpacked Same sesult: org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: Need to set the destination artifact repository location. --- Is it too much to ask that you document how this works? Are we really expected to go browse the source? Surely Pascal's request to have people kick the tires here [1] wasn't just for show? [1] http://lenettoyeur-on-eclipse.blogspot.com/2009/05/p2-call-for-community-testing.html Of course documentation will be done. *** This bug has been marked as a duplicate of bug 264741 *** (In reply to comment #11) > Of course documentation will be done. In the time it takes to tell me you're going to document it, you could have just answered the question, 'what flag do I use to define the "destination artifact repository location"?' Whereupon *I* would have documented it myself in the wiki, as I've done for other p2 apps. Pay it forward, you'll be rewarded. :) (In reply to comment #12) > In the time it takes to tell me you're going to document it, you could have > just answered the question, 'what flag do I use to define the "destination > artifact repository location"?' The answer is "I don't know", and I'm sure DJ is in about the same position. I've always used the ant task. Comment #3 is what I got from looking at the source code. If you say -destination doesn't work then I will need to actually debug it to see what is happening. Reopening and renaming to reflect the actual problem here, as stated in comment 7: ... -application org.eclipse.equinox.p2.repository.repo2runnable -destination ... does not work, throwing this error: org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: Need to set the destination artifact repository location. Created attachment 137052 [details]
patch
patch released. Both -source and -destination must be proper URLs to the repository (which means jar: urls for zip files). You can have multiple -source, but it only makes sense to have one -destination. Note the command line app has no way to distinguish artifact from metadata repos so the URL is treated as both artifacts and metadata. If the argument is not both metadata and artifact, then there may be an exception. The ant task allows distinguishing them. |
Created attachment 136827 [details] script to run repo2runnable and create an all-in-one zip; works in Eclipse VM but not in a separate VM The attached script works great if you run the "runInEclipse" target with "Run in the same JRE as the workspace" set on the launch config. However, trying to run it in a different VM (ie., commandline) yields this error: runInAnt: No public execute() in class org.eclipse.equinox.p2.internal.repository.tools.Repo2Runnable BUILD FAILED /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng_HEAD/tools/scripts/p2repoFormatToRunnableSDKFormat.xml:14: No public execute() in class org.eclipse.equinox.p2.internal.repository.tools.Repo2Runnable Could a public method be added? Or is this task meant to be called by some other task wrapper? Or could an antlib.xml file be added into the org.eclipse.equinox.p2.repository.tools_*.jar, so these tasks are accessible outside an OSGi environment that knows how to read and resolve plugin.xml files?