|[tycho-user] Tycho cannot find p2 advice file during product materialization|
I’m attempting to associate a p2 advice file with my product definition as described on the wiki . My product definition file is named “com.utc.pw.ome.idds.product.workbench.product”, thus I named my p2 advice file “com.utc.pw.ome.idds.product.workbench.p2.inf”. However, Tycho doesn’t appear to copy the p2.inf file to the appropriate location under target/products for it to be processed by the p2 director.
Looking through the code, I found the relevant bit that computes the name of the product’s p2 advice file in o.e.t.plugins.p2.publisher.PublishProductMojo.getSourceP2InfFile() :
// This must match org.eclipse.tycho.p2.impl.publisher.ProductDependenciesAction.addPublisherAdvice(IPublisherInfo)
final int indexOfExtension = productFile.getName().indexOf(".product");
final String p2infFilename = productFile.getName().substring(0, indexOfExtension) + ".p2.inf";
return new File(productFile.getParentFile(), p2infFilename);
It appears the problem is that my product definition file uses “.product” in the base name, as well as using it as the extension. Thus, the above code finds the first occurrence of “.product” and expects a p2 advice file named “com.utc.pw.ome.idds.p2.inf”. I verified that renaming my p2 advice file to this value causes the build to behave as expected.
Obviously, my problem could be solved by replacing indexOf() with lastIndexOf() in the above code (and in ProductDependenciesAction.addPublisherAdvice). Before I submit a change request, I just wanted to verify that this is a legitimate defect and not that I’m violating some product naming convention of which I’m unfamiliar.
Back to the top