Search code examples
javaeclipsecopyactionp2

Eclipse p2 touchpoint copy from jar


I need to copy file in the configure phase which is located in jar to a folder but I am not sure what is the right way to do it and if it even possible. Here is what I have in my p2.inf file:

instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${artifact.location}/res/np.sys, target:D:/np.sys, overwrite:true);

My file is located in the jar -> res/np.sys but with that I have IOException that the file do not exists

 Source: d:\Program Files\Test Program\plugins\com.vendor.testprogram.p2.installaction_1.0.0.201707210555.jar\res\np.sysdoes not exists

Solution

  • The way to do this is to have the JAR unpacked by the installation of the product, either by:

    • adding the plugin to a feature with "Unpack the plug-in archive after the installation" checked, or
    • directly within the plugin's MANIFEST.MF file with Eclipse-BundleShape: dir

    The copy will then be successful.