简体   繁体   中英

Is there a way to include regular maven dependencies in an eclipse plugin

I am building a framework and want to use it both as a standalone java application and as an eclipse plugin which exports all the packages in the java project.

The current way I do this is by having two projects (java + eclipse plugin), building the java project, copying the jar file, adding the file to the plugin's path and then (manually) exporting all the packages.

Is there a way to automate this process using maven?

The Eclipse Tycho project is aimed at building Eclipse plugins with Maven.

Tycho is a set of Maven plugins and extensions for building Eclipse plugins and OSGi bundles with Maven. Eclipse plugins and OSGi bundles have their own metadata for expressing dependencies, source folder locations, etc. that are normally found in a Maven POM

You should be able to have a single project, and Tycho will take care of building a proper OSGi bundle, with MANIFEST, xml config, etc.

We are in a very similar situation and solved this using the maven-eclipse-plugin for getting the project to work within Eclipse with all pom dependencies as embedded jars.

At the moment we started, Tycho was not very mature and we decided to work pom-first. We do this by also using the org.apache.felix maven-bundle-plugin to generate the manifest.mf and make the final deployable bundle/standalone application.

Ufortunately this kind of build gets mind-boggling to understand very quickly and can take a lot of effort any time you need to update dependencies....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM