Community
Participate
Working Groups
I'm having problems with the BundleAction in the Publisher not recognizing the existence of ".pack.gz" files. I ran the debugger and ended up in the following code in BundlesAction.generateBundleIUs() at line 721: // Publish according to the shape on disk File bundleLocation = new File(bd.getLocation()); if (bundleLocation.isDirectory()) publishArtifact(ad, new File(bd.getLocation()), new File(bd.getLocation()).listFiles(), info); else publishArtifact(ad, new File(bd.getLocation()), info); The bundleLocation in my case is always the bundle jar so I end up in the second publishArtifact(). The code that adds the corresponding .pack.gz file however, is only present in the publishArtifact() that is called when bundleLocation is a directory. This never happens. Looking at the deprecated Generated.generateBundleIUs(), I see similar code as the one above, but there it's followed by this (line 409): if (info.reuseExistingPack200Files() && !info.publishArtifacts()) { File packFile = new Path(bd.getLocation()).addFileExtension("pack.gz").toFile(); //$NON-NLS-1$ if (packFile.exists()) { IArtifactDescriptor ad200 = MetadataGeneratorHelper.createPack200ArtifactDescriptor(key, packFile, ad.getProperty(IArtifactDescriptor.ARTIFACT_SIZE)); publishArtifact(ad200, new File[] {packFile}, destination, true); } }
I can provide a patch for this unless someone is already working on it (if so, please let me know ASAP).
Sure. Patch appreciated. I'm doing work in here right now so could take a look.
Created attachment 126739 [details] Patch to BundleActionTest that highlights the issue (part 1) I divided this patch into two parts to make the code viewable. The second patch is a binary .pack.gz file that goes into testData. Both patches must be applied for the test to run.
Created attachment 126740 [details] Patch to BundleActionTest that highlights the issue (part 2) Additional test data for the BundleActionTest
Created attachment 126745 [details] New version of Patch to BundleActionTest (part 1) Just discovered a merge conflict in PublishActionTest. So here's a new version.
Created attachment 126746 [details] Patch to make BundleAction recognize pack.gz siblings The code was there, but in the wrong place. This patch overrides the correct method (the one that is called when a jar file is encountered) and the code to create the .pack.gz descriptor was moved to that method.
Any chance this bugzilla can be attended to anytime soon? We use the publisher in our builds now and would really appreciate if it picked up the .pack.gz files and added them to the ArtifactRepository.
Sorry for having let that rot. Thomas could you please provide an updated version if this has not been fixed? Thx
(In reply to comment #8) > Sorry for having let that rot. Thomas could you please provide an updated > version if this has not been fixed? Thx > As far as I can see, it has not been fixed and I'd be happy to provide a new patch. Right now I have another patch pending that concerns the same file in bug #269170. Perhaps you could apply that patch first? Otherwise it will render a new patch here stale. I can of course provide a patch that contains both changes if you'd prefer that.
I have released patch for bug #269170. I would appreciate if you could provide a patch.
Created attachment 130317 [details] Up to date patch to BundleActionTest
Created attachment 130318 [details] Up to date patch to fix the problem.
The binary patch containing the test data (a pack.gz file) didn't need an update. 1. Apply the binary patch + the BundleActionTest patch (I kept them separate to keep the latter readable). 2. Run the patched BundleActionTest. It should now fail since no pack.gz is generated. 3. Apply the fix patch. 4. Run the modified test again. This time it should succeed.
released
.