2009/7/14 Lewis, Eric <[email protected]> > Hi > > I need to gather all dependencies from a Maven POM and copy them to an > Eclipse plugin directory and then create that plugin from that which covers > all the JARs and exports all the packages. > > The question is: How can I do that? > > One of the tools would be the 'bundleall' goal of the Felix Maven plugin,
the 'bundleall' goal simply takes all your project dependencies and turns them into separate bundles using a very simple "export all" approach - it wasn't designed to be used to create Eclipse plugins, but was more of a 'mass-conversion' tool for simple projects but somehow it looks for way too many dependencies. When I use the similar > dependency:copy-depencies, I don't run into the same trouble. Specifically, > it seems that deep down, somewhere, I have a dependency which can't be > resolved, because the artefact 'stax:stax-ri:jar:1.0' can't be found. > > So the question is: Can I configure the 'bundleall' goal to exclude certain > dependencies? you can configure the maximum dependency depth for 'bundleall', but you can't exclude specific items > From debugging the Maven output, I don't see any configuration possibility: > [DEBUG] Configuring mojo > 'org.apache.felix:maven-bundle-plugin:2.0.0:bundleall' --> > [DEBUG] (f) baseDir = C:\jp\client > [DEBUG] (f) buildDirectory = C:\jp\client\target > [DEBUG] (f) localRepository = [local] -> file://C:\Documents and > Settings\lewis_lee\.m2\repository > [DEBUG] (f) manifestLocation = C:\jp\client\target\classes\META-INF > [DEBUG] (f) outputDirectory = C:\jp\client\target\bundles > [DEBUG] (f) project = MavenProject: ch.ipi:client:1.0.0-SNAPSHOT @ > C:\jp\client\pom.xml > [DEBUG] (f) remoteRepositories = [[repository.central] -> > http://repository/content/groups/public, [central] -> > http://repo1.maven.org/maven > 2] > [DEBUG] (f) supportedProjectTypes = [jar, bundle, ejb] > [DEBUG] (f) wrapImportPackage = * > > Or could I use the dependency plugin, download what I need and trick the > Felix plugin into believing that the target directory is my repository? > > Ok, the other question then is: How do I create an Eclipse plugin from > this? Would the POM described under 'Eclipse/PDE integration' be sufficient > to create an Eclipse project? > the simplest way is to ignore the 'bundleall' goal and change your POM to use the 'bundle' packaging, you'd then get automatic manifest generation, fine control over embedding/inlining dependencies, and generation of OBR metadata (handy for when you're deploying bundles) look at Embed-Dependency in http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html to see how to pull dependencies into your plug-in - this will also let you filter out unwanted jars you can use the configuration under 'Eclipse/PDE integration' to generate the manifest in the place that PDE expects it and arrange for embedded jars to be where PDE expects them (PDE basically assumes the bundle is unpacked under the project directory, which conflicts with the Maven layout) alternatively look at http://www.ops4j.org/projects/pax/construct - you can use these scripts to create plug-in projects (uses Maven archetypes underneath) and the generated projects have built-in support for Eclipse/PDE - just uncomment the "ide-support" execution in the top-level POM to update the PDE project information automatically on each build, or use "mvn install pax:eclipse" (it's like eclipse:eclipse but has better OSGi support) http://www.jroller.com/habuma/entry/pax_construct_from_zero_to also have a look at the Tycho project, which might be a better fit if you're primarily working in Eclipse: http://www.sonatype.com/people/2008/11/building-eclipse-plugins-with-maven-tycho/ http://docs.codehaus.org/display/M2ECLIPSE/Tycho+user+docs HTH Thanks for any help! I don't know a lot about OSGi, I just have to build it > ;-) > > Best regards, > Eric > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Cheers, Stuart

