How do I set permissions on files in an unpacked Eclipse Plugin (not a jar) - eclipse

I have created an Eclipse feature set, composed of various plugins. One of these plugins contains an executable file that gets called from the plugin. The feature.xml file sets unpack="true" for this plugin, so it is installed as a directory rather than a jar.
But when Eclipse tries to launch the executable, it throws a "permission denied" error. Running chmod on the exectuable fixes this ... but I need this to happen automatically when people install the Eclipse plugin.
I've ensured that the executable file has the correct permissions before I build the plugin.
I'm thinking maybe there's a way to add installation tasks to a feature.xml, perhaps?

Figured it out, p2 TouchPoint instructions enable the execution of commands during the installation of a plugin.
http://wiki.eclipse.org/Equinox/p2/Engine/Touchpoint_Instructions_35

Related

Maven dependency Hibernate library cannot be read

I'm getting the following error in eclipse.
Archive for required library: '~/.m2/repository/org/hibernate/hibernate-core/4.2.1.Final/hibernate-core-4.2.1.Final.jar' in project
I've done Maven->Update Project and still it can't recognize the library.
I've verified that the jar file exists in the location mentioned.
This post has the same error as I do but I double checked my pom and there are no duplicates.
Check access settings for file '~/.m2/repository/org/hibernate/hibernate-core/4.2.1.Final/hibernate-core-4.2.1.Final.jar' if you are using *nix system,
Also make sure you can open hibernate-core-4.2.1.Final.jar archive using third party tools e.g. 7zip or winrar. from my experience many times maven in eclipse does not properly download dependency and downloaded jar is corrupted. If that is the case you can manually download this jar and replace it in .m2 repository.
Try to run maven task eclipse:eclipse from command prompt
open command prompt, Change Directory to project root directory and type
mvn eclipse:eclipse
And go back to eclipse and refresh project and see will it works :)

Plugins in dropins-catalog are not found

What could cause Eclipse to ignore plugins in the dropins catalog?
I've created a dummyplugin based on the Eclipse wizard, exported it to a jar. When dropping it into the drop-ins catalog of a fresh Eclipse installation, it works fine.
When I do the same thing but on a custom Eclipse installation, it doesn't work. The plugin doesn't even show up in the plugin registry view. No error messages or anything like that.
I've tried:
Running with -clean
Running with -clean -consoleLog but no errors were printed
Starting up with -console, and checking if the plugin is seen with the command ss, no luck.
Running with -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:\Program\Eclipse\eclipse3.6\dropins\
Changing name of the eclipse catalog from eclipse3.6 to eclipse, in case I had run into a variation of an Eclipse bug
It's not due to dependency issues (like this question), since the plugin isn't even found
Update Copied the eclipse.ini from the working eclipse installation to the custom one, with the same result; The plugin wasn't found. So the issue isn't in the ini file
Update Thought the issue might be some rights issue, since I my user wasn't the owner of the custom installation. So I made a copy of the entire dir of the custom installation to make sure I was the owner with full rights. No change
Update Starting with a new workspace doesn't make any difference
Is it possible to define that Eclipse should ignore the dropins catalog? How?
The custom version of Eclipse defines a lot of variables, but nothing that seems related to p2 or the behaviour of dropins.
The dropins/ folder is a best effort, totally optional, silently failing legacy leftover. Not big on the diagnostics, as you've found.
If you use the director to install your bundle into your custom eclipse, at least you'll be able to get an error message that will tell you what the problem is.
I'd suggest exporting your jar with some minimal p2 metadata.
Then you use something like:
eclipse/eclipse \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository \
file://$HOME/eclipseUpdate \
-installIUs \
org.dojotoolkit/1.6.1.v201105210659
If p2 can't find some dependency, it should spew out the confusing error messages it can generate.
Hi #Fredrick I've made my own plugin and I've added to my eclipse in this way:
Export the plugin as Deployable plug-ins and fragements.
(Right click on the plugin project - Export - Plugin Development - Deployable plug-ins and fragements)
That will generate a .jar file that file you have to copied into \eclipse\plugins
Restart eclipse.
I'd say that will be all.

Eclipse RCP: build product able to load all plugins in plugins directory

I need to configure my eclipse product to load all features/plugins in features/plugins directory. Now my product loads just plugins that are listed in metadata, so if I export some plugin directly from eclipse tool as "deployable plugins" it's loaded in my product, but if I put a plugin jar directly in plugins directory It doesn't appear (the same if I work with features)
I simply make new product configurations, put the feature that contains my application plugin and then exporting product I have this problem.
My eclipse version is 3.6.1
I think the problem is in the launcher configuration but I don't know what I have to change
In theory, your exported RCP application should simply pick up any new features and plugins you add later. However, make sure you put the extra stuff in the dropins folder of your RCP, since this is the expected location for manually installed features since the introduction of p2.
If for some reason it still doesn't work, try launching Eclipse with the -clean command line argument.
According to The Eclipse runtime options page, the -clean argument has the following effect:
[...] any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.
In my experience this can resolve many mysterious cases, where newly added plugins are not loaded by Equinox.

Target Platform for PDE Headless build does not work

I am currently trying to get my headless pde-build working but I am stuck on a point where I do not know how to continue.
The problem is how to define the related target platform to compile the plugins against.
I have a build.bat with the following call (all in one line!):
java -jar D:\target\eclipse\plugins\org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-application org.eclipse.ant.core.antRunner
-f D:\target\eclipse\plugins\org.eclipse.pde.build_3.5.2.R35x_20100114\scripts\productBuild\productBuild.xml
-Dbuilder=c:\pde-build\scripts %*
I tried to create the target eclipse platform from different parts: The eclipse SDK, RCP SDK, Delta Pack, PDE-SDK in all combinations but none of them worked well.
I got the following error:
BUILD FAILED
D:\target\eclipse\plugins\org.eclipse.pde.build_3.5.2.R35x_20100114\scripts\productBuild\productBuild.xml:18: Cannot fin
d ${eclipse.pdebuild.scripts}/build.xml imported from D:\target\eclipse\plugins\org.eclipse.pde.build_3.5.2.R35x_2010011
4\scripts\productBuild\productBuild.xml
where the variable ${eclipse.pdebuild.scripts} does not got resolved. I also tried to give this parameter via the command line but then I got another error regarding missing svn task which is absolutely confusing as this is working with my local eclipse installation referenced.
When I replace the path from d:/target/eclipse to my local eclipse installation the pde build works as expected!
This leads my to the point that the configuration of the target eclipse is not correct but in the moment I have no idea how to configure this!
My goal is the automate the pde build first on my local site without referencing my local eclipse and later on integrate this building process into our running cruisecontrol instance.
As I saw already another question about defining the target eclipse I would be happy if anyone can contribute hints or facts regarding the problem.
Regards,
Andreas
When performing a headless build, the target can be separate from the eclipse that is actually running the build itself. The problem you had here is that the eclipse that you were using to run the build did not have PDE/Build properly installed.
This is why the ${eclipse.pdebuild.scripts} was not set, because PDE/Build was not installed into that eclipse instance, the org.eclipse.pde.build bundle was not resolved and the code that sets this property never got called. Similarly, the necessary ant classpath entries for PDE/Build tasks would not have been set up properly either.
You need the Eclipse with PDE installed inside to run the build, but the target for the build can be separate from this.
In the build.properties file found under -Dbuilder=c:\pde-build\scripts you can set several properties:
baseLocation This is a path to an eclipse that is your target.
buildDirectory This is where the build will actually take place, source is fetched to plugins/ and features/ subfolders, but if there are already binary plugins located here then those become part of the target as well.
pluginPath This is a list of paths (separated with ';' on windows or ':' on linux) containing other locations that should be considered as part of your target. These locations can be several things:
The root of an eclipse-like install with plugins/ and features/ subfolders. This is a good way to provide the delta-pack instead of just unzipping it on top of an eclipse install.
The root of a workspace-like folder, where all subfolders are treated as plugins or features depending on the presence of a manifest or feature.xml.
The root of a bundle or feature, or the jar for a bundle.
If you are doing a p2 build (p2.gathering = true) you can also provide p2 repositories under a ${repoBaseLocation} which will be transformed and placed under ${transformedRepoLocation} and will become part of your target, and the p2 metadata there will get reused during the build.
after some more time of investigation I found out, what I did wrong so far. As I mentioned above defining the target platform is not that easy as copying the SDK and plugins in into one location (as it was in early times of eclipse dev).
The working solution by now is the following: Copying the eclipse SDK into the target location and run this version. Install inside this the neccessary PDE-Tools to enable plugin development. After that, close the IDE and copy the delta pack + the respective svn plugin (I used org.eclipse.pde.build.svn-1.0.1RC2 from sourceforge) into the target platform and you're done.
Now my automated PDE build is running as expected.
Only minor issue now is the following: The result product contains eclipse-specific menu entries which are not there when I ran this from inside my dev-eclipse.
Any hints on that?
I just posted an answer to my question on this kind of topics, may be this can help you:
Plugin product VS Feature product

Modifying Existing Eclipse Plugin and Correctly Installing it

I downloaded the source code for the EMF based UML2 Plugin and changed a class in the org.eclipse.uml2.uml.edit project to remove special characters when returning string representations. Now when I export the projects and place the jar files either in the dropins directory or replace my current uml2 plugin jar files in plugins directory, The UML files are no longer recognized, in short my modified plugin does not install correctly (no error is thrown and I can see the files being picked up under Plugins->Target Platform) .
However, When I run the plugin as an eclipse application (from the workspace) I can see the changes I made being reflected in the new instance of eclipse.
What can I do to ensure that the plugin installs correctly?
Is there a documented procedure of how to build the uml2 plugin (or any comparable plugin) after modification?
Select the project and open the context menu. There is an entry PDE near the bottom of the menu. In there, you can find an entry to build the plugin for deployment. This gives you the features and plugins directory with the fixed files. Copy both into your Eclipse install.
Unless the UML2 plugins require some kind of magic build script, exporting the one plugin you changed and overwriting the original in your Eclipse installation should be the easiest solution. One potential problem which comes to mind is conflicting plugin version numbers: make sure you don't have two identical versions of your modified plugin in your Eclipse installation.
When debugging plugins which apparently don't work properly at runtime, I always look at Help > About Eclipse Platform > Configuration Details. This lists all the plugins found by Equinox during startup, along with their status (see the Javadoc of the org.osgi.framework.Bundle interface for explanation).
I faced the exact same problem as you describe here . I dont have any answer to your problem but i am sharing what worked for me .
I created a local update site of the plugin on my system. Create update site for your plug-in article explains very very nicely the steps needed to accomplish this .