I've created a project in eclipse and I want to use the equinox jars which are available in local repository i.e. I don't want to use equinox from eclipse. How can I achieve this?
For Example: If I create any project in eclipse and want to use OSGI framework then eclipse automatically uses the equinox jars which are available for that particular version of eclipse. But I don't want to use the eclipse's equinox jar. I want to specify some location for my project from where it can load the equinox jars.
Add a dependency for a concrete version in your pom file. That will add the jar file to your class path and your application will use that concrete version
Related
I have a simple basic question. If I develop plugin for Kura in eclipse with maven, can I use dependency feature of Maven? I mean, when I use Maven for my Spring projects, I simple add dependency to pom.xml file and I can use in my project. Since I run Spring project on my local machine, dependent .jar files can be used runtime. This time, I will deploy my plugin to another device (Raspberry) , I have to put everything in the bundle .jar package. Can Maven do this or should I add dependent .jar files to classpath manualy?
You can use maven shade plugin to build the so called uber-jar - one jar that will contain your project along with all the dependencies.
We have a multi-module maven project that was recently converted from Ant+Ivy. One of the modules is a legacy custom pluggable component which looks for plugins on the classpath and loads them. Another module in the multi-module project is a plugin implementation that is run by the aforementioned plugin.
When running our custom application server from an eclipse run configuration, we must include each of our plugins on the classpath. As we build within the eclipse workspace these plugins are not compiled to a jar. Hence, there is no jar artifact to include.
If I add the plugin module project as a dependency in the eclipse run configuration, its transitive dependencies (supplied by Maven) are not inherited. Hence, class not found exceptions occur when the plugin is found and loaded by the Application Server.
The problem here is that upon importing the multi-module project, the m2e plugin does not set the maven container to be exported. Thus the missing transitive dependencies.
Is there any way to make this work whilst still running in eclipse using "build in workspace" for both the Application Server component and its plugins.
Ivy is just a dependency management tool where as Apache Maven is a software project management.
Means It can handle all process in software development like compiling,building it to jars, search for depencies,linking, etc.
you no need to give your jars in classpath instead put it in your local repository or edit the pom.xml to fetch from remote repository.
this link http://ant.apache.org/ivy/history/2.0.0/use/makepom.html
I am creating an eclipse plugin that calls some classes from a Java project. I have added this Java project as a required project on my build path.
When I create an eclipse plugin jar using an ant script, everything works fine.
However when I try to debug the code at run time or open the eclipse as a run time application, the classes from the Java project are not accessible. I get a NoClassDefFoundException.
Is there something I am missing while adding the dependancy?
Eclipse is based on OSGi, and as a rule of thumb, bundles can only see other bundles. Usually for including 3rd party jars in an eclipse plugin, you have 2 choices:
1) Include the jar in your eclipse project. Add it to the build.properties. Edit the MANIFEST.MF and add it to the Classpath section on the Runtime tab.
2) turn the 3rd party jar into a bundle so that your eclipse plugin can require it. You can use File>New>Other...>Plug-in Development>Plug-in from Existing JAR. The simplest form of an OSGi bundle is just the original jar with OSGi headers added to its MANIFEST.MF.
EDIT:
Remember also you have to honour the 3rd party jar license with whichever option you choose.
We have existing maven project. I have imported it with m2eclipse plugin.But
I can not run the project. Tomcat can not see resources(WAR files under target folder).
What am I missing? BTW we have multi-module project(2 WAR files).
Thanks in advance!
You need to add the tomcat server in your eclipse.
The maven project should be a web based project
You need to add the web project to the tomcat server.
You need to add J2EE Module Dependencies - Eclipse 3.3 ( To enable all library dependencies to be available at runtime to tomcat). Paths that point to your m2 repo & the lib files.
It may be Java EE Dependencies in earlier versions.
Both your projects needed to be added similarly.
Is there a way to do incremental deployments with these three tools when in a multi-module project?
Example of Maven project:
project
project-data
project-service
project-webapp
The above are Maven modules with dependencies between them. The project-webapp module contains the .war file, but I don't want to create a new .war file every time I need to deploy. Is there a way to perform deployments upon file saves?
Use the Eclipse WTP support (and either the maven eclipse plugin or m2eclipse to import your project as a dynamic project). Did you try? Are you facing any particular problem?