Bug 369537 - Manifest generation should cope no src/main/resources/META-INF/MANIFEST.MF present
Summary: Manifest generation should cope no src/main/resources/META-INF/MANIFEST.MF pr...
Status: NEW
Alias: None
Product: Virgo
Classification: RT
Component: tooling (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 368782
  Show dependency tree
 
Reported: 2012-01-24 10:44 EST by Nobody - feel free to take it CLA
Modified: 2012-02-08 13:34 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody - feel free to take it CLA 2012-01-24 10:44:30 EST

    
Comment 1 Nobody - feel free to take it CLA 2012-01-24 11:07:00 EST
Using the Virgo IDE tooling with the Virgo kernel, a clean rebuild under Eclipse results in missing manifests.

To recreate, build the kernel using ant and then run StandardKernelIntegrationTests (in org.eclipse.virgo.kernel.test) as a JUnit test under Eclipse and it will pass. Then clean/rebuild the project org.eclipse.virgo.kernel.artifact under Eclipse after which re-running the unit test fails with the plugin conversion error below due to there not being a manifest in target/classes.

org.osgi.framework.BundleException: Error converting plugin at /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel/org.eclipse.virgo.kernel.test/target/org.eclipse.osgi/bundles/41/1/bundlefile.
	at org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook.generateManifest(EclipseStorageHook.java:451)
	at org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook.getGeneratedManifest0(EclipseStorageHook.java:428)
	at org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook.getGeneratedManifest(EclipseStorageHook.java:397)
	at org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook.createCachedManifest(EclipseStorageHook.java:392)
	at org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook.getManifest(EclipseStorageHook.java:512)
	at org.eclipse.osgi.internal.baseadaptor.BaseStorage.loadManifest(BaseStorage.java:316)
	at org.eclipse.osgi.internal.baseadaptor.BundleInstall.begin(BundleInstall.java:82)
	at org.eclipse.osgi.framework.internal.core.Framework.installWorkerPrivileged(Framework.java:930)
	at org.eclipse.osgi.framework.internal.core.Framework$1.run(Framework.java:838)
	at org.eclipse.osgi.framework.internal.core.Framework$1.run(Framework.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.Framework.installWorker(Framework.java:897)
	at org.eclipse.osgi.framework.internal.core.Framework.installBundle(Framework.java:833)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:137)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:131)
	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.installAndStartBundles(FrameworkBuilder.java:178)
	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.start(FrameworkBuilder.java:159)
	at org.eclipse.virgo.test.framework.OsgiTestRunner.launchOsgi(OsgiTestRunner.java:171)
	at org.eclipse.virgo.test.framework.OsgiTestRunner.run(OsgiTestRunner.java:84)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.eclipse.osgi.service.pluginconversion.PluginConversionException: Could not find a META-INF/MANIFEST.MF, plugin.xml or a fragment.xml in /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel/org.eclipse.virgo.kernel.test/target/org.eclipse.osgi/bundles/41/1/bundlefile.
	at org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl.fillPluginInfo(PluginConverterImpl.java:114)
	at org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl.convertManifest(PluginConverterImpl.java:714)
	at org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook.generateManifest(EclipseStorageHook.java:448)
	... 24 more


To see the bundle manifest generation failure, open template.mf in org.eclipse.virgo.kernel.artifact under Eclipse and click on the "Update MANIFEST.MF" link in the Overview pane. The error log then shows the following error:

java.lang.RuntimeException: No value found for placeholder 'version'
	at org.eclipse.virgo.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:117)
	at org.eclipse.virgo.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:129)
	at org.eclipse.virgo.util.common.PropertyPlaceholderResolver.resolveProperty(PropertyPlaceholderResolver.java:109)
	at org.eclipse.virgo.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:102)
	at org.eclipse.virgo.bundlor.support.propertysubstitution.PlaceholderManifestAndTemplateModifier.modify(PlaceholderManifestAndTemplateModifier.java:55)
	at org.eclipse.virgo.bundlor.support.StandardManifestGenerator.generate(StandardManifestGenerator.java:54)
	at org.eclipse.virgo.ide.bundlor.internal.core.BundlorProjectBuilder.generateManifest(BundlorProjectBuilder.java:610)
	at org.eclipse.virgo.ide.bundlor.internal.core.BundlorProjectBuilder.build(BundlorProjectBuilder.java:216)
	at org.eclipse.virgo.ide.bundlor.internal.core.BundlorProjectBuilder.build(BundlorProjectBuilder.java:154)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
	at org.eclipse.core.internal.resources.Project.build(Project.java:124)
	at org.eclipse.virgo.ide.bundlor.ui.BundlorUiPlugin$RunBundlorJob.run(BundlorUiPlugin.java:100)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Now add a META-INF folder with a MANIFEST.MF under src/main/resources and put the following text in the manifest:

Manifest-Version: 1.0

followed by a newline. Clicking on the Update MANIFEST.MF link now successfully generates a manifest in target/classes as well as updating the manifest created above.

However, we need to get to a point where we can do without the manifest in src/main/resources/META-INF as this is confusing and a source of all sorts of issues and it was a great step forward when we were able to delete it (although we didn't realise how precarious running integration tests under Eclipse had become).