Can not import packages at plugin.xml from jars which are loaded as maven dependency? - maven

I would like to take advantage of the features that Maven provides for managing dependencies in a project. My brief understanding of how Maven works is that it will aquire the JARs needed and then build the project with these libraries. So i have installed and configured maven on my computer. Also i have installed the me2eclipse plugin version 0.12 on my eclipse helios.
I have been created a maven project and configured the pom. I added some dependencies to maven and maven was checking out the dependend jars to %userprofile%/.me2/repository. This works fine. But i would like to import some packages from the jar files which are located at the maven dependencies at my plugin.xml which are used by running a eclipse rcp plugin. The maven dependencies are added to my classpath as well.
I don't know were the mistake is? Can any body help my. Thanks.

The answer is, thats not possible to import some packages from jars or bundles which are loaded as maven dependency (stored at the maven local repositiry) at the eclipse rcp plugin dependency or MANIFEST. You can only import bundles or packages from jars which are located at the eclipse target platform. So the solution is to add the bundles which ar located at the local maven repository to the target platform as well.

You should take a deep look at Maven-Felix which supports you in this kind of building. Furthermore i recommend you to update to Eclipse-Indigo and use the integrated (Marketplace) m2e instead of the old m2eclipse plugin.

Related

How to add unmanned jars directory to specif profile in Maven with out install

I want to add my jars library which is c:\tmp\jars\ (more than 100 jars files) to specific profile in Maven with out installing.
Installing each jar in maven and adding each dependency is not i'm looking.
I'm using Intellij and Maven
I can add the jar directory by project module settings add Jars but its applicable to all profiles, i want add this jars to specific profile.
for example y project has 2 profiles hdp,azure
for hdp profile the external jars not required but azure profile the external jar required.
Agian I don't want to install in maven add each dependency is not my option.
If the jars are not listed as dependencies in your POM, Maven cannot see them.
Even if IntelliJ sees them, you get a strange hybrid project that Maven cannot build any more.

Update Maven Dependencies Jars

I am new to Maven and have a quick question. I am using the JBoss IDE and have my Maven project set up. I have several jar files in my Maven Dependencies build path that need to be updated to a newer version. I have tried adding the external jars manually, but they do not go within the Maven Dependencies library and the outdated jar remains within that library.
What is the best way to update the jars with the Maven Dependencies library?

How to include csjdbc.jar as part of maven dependency?

I have been looking for a dependency for csjdbc.jar in Maven repository so that I can build my app using maven and retrieve that jar on the fly. However, I cannot find a dependency in Maven repository related to that jar. Can anyone help, please?
Hopefully you have already resolved this issue.
csjdbc.jar is not listed in maven repositories. If you have composite software installed you can copy the jar from
~\Composite Software\CIS 6.1.0\apps\jdbc\lib
directory to your local machine's maven repository like below with proper versioning:
C:\maven\repository\composite\csjdbc\6.1\csjdbc-6.1.jar
(I have 6.1 jar)

Maven plugin Tycho -> when to use it and when not to use it

What is the purpose to use Maven Tycho plugins. I read here tycho is used for building eclipse plugins and OSGI bundle.
Questions:- Can not we build eclipse plugins and OSGI bundle just by using the plain old maven POM.xml file[by not using tycho plugin].
What does maven need tycho plugin to help it build eclipse plugin and OSGI bundles?
Why should we use Maven tycho plugin to build eclipse plugins and OSGI bundles?
When using maven (or other command line build tools) manifest.mf) in combination with Eclipse (or another IDE) the classpath ends up being written down twice - once in the pom.xml and once in the Eclipse .classpath (or, for OSGi, in the target platform and manifest.mf). This violates the DRY principle.
There are various solutions to this problem. One is something like m2e, where you use the pom.xml to generate the Eclipse .classpath. Alternatively, you can go in the other direction and start by getting things compiling in Eclipse, and then use a maven plugin to convert that Eclipse setup to a maven build. This is what Tycho does, with the extra wrinkle that it works from a PDE manifest + target platform rather than directly from the .classpath.
Maven doesn't have a built-in packaging type for OSGi bundles and/or Eclipse plugins. So unless you want to use the jar packaging type and manually add OSGi specifics, you need a Maven plug-in to help you with this.
Tycho is one of the plugins that add support for building OSGi bundles.

Maven beginner question, get m2eclipse to download jar and add to build path?

From what I have read, after adding the relevant maven repositories, maven should automatically download the necessary jars to satisfy dependencies in the pom.xml file.
However, no jars ever get downloaded for me after I add dependencies in eclipse. Am I missing some glaringly obvious step?
I'd recommend to start from creating your project with m2eclipse. See more details in this article.
Basically, you need to make sure the following:
your Eclipse project has a valid pom.xml and all dependencies are available (you should see errors on Maven console, in the Problems or Markers view or when opening pom.xml in m2eclipse's POM editor)
Maven support is enabled for this project (you can use Maven / Enable Dependency Management from popup menu on that project)
project configuration is in sync with pom.xml (you can use Maven / Update Project Configuration from the project popup menu)
you can also use Maven / Update Dependencies to refresh your dependencies (e.g. when you got them in your Local Maven repo from the command line)
Dependencies jars aren't in your project but in your local maven repository.
These jars will be automatically used when you compile you project with maven (or m2eclipse).
If you don't have the needed jar yet, maven will download it for you.

Resources