Need Apache commons-lang3 as dependency of an Eclipse plugin built with Tycho

I'm having one of those nights... I'm developing an Eclipse plugin using Tycho (the Maven extension), and at some point I wanted simply to use the class StringUtils from org.apache.commons. After some research, the only way that I could find is the following code in my pom.xml parent file:




This didn't work, and any other solution that I tried didn't work either. I'm using Maven for the first time, so maybe I'm missing something (or a lot of things)... Does anyone have an idea? I'd be very thankful :o)


Your configuration looks correct. So if it doesn't work, you are probably missing the dependency declaration in the MANIFEST.MF. To do this, e.g. add Require-Bundle: org.apache.commons.lang3 in that file.

Background: A dependency in the POM doesn't automatically mean for Tycho that your bundle also automatically has this dependency. It only means that the artifact will be added to the target platform (given that pomDependencies=consider is configured and the artifact is an OSGi bundle - both is true in your case). Once it is in the target platform, it can be used to resolve the dependencies declared in your bundle's MANIFEST.MF.

It sounds like you need to "upgrade" to using a target platform to define your target.

How are you achieving this dependency in your development environment? If you are not using a target platform, you are inheriting whatever plug-ins are installed in your development (that is the default target platform).

Create Target Platform

First create a target platform. I recommend using the Target Platform Definition DSL and Generator to create and edit the target platform.

The tpd file will look something like this for orbit

target "name"

with source requirements

location "" mars-orbit {

location "" mars-release {

This example uses the already created OSGi bundles for third-parties. You can choose which release of orbit and browse all the available packages on the Orbit Site. You can also use auto-completion in the tpd editor.

Tycho Using Target Platform

Place the target file in a new plug-in. Name the target file the same as the plug-in. (e.g. is the name of the target file in this example.)

In this project, a pom that looks like this:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

You can configure (in your releng pom.xml) the target configuration like this:


Have a look at Code & Me's excellent tutorial on Tycho, it goes into more detail and over many steps goes from new project to a complete Tycho.

Need Your Help

oracle subtract 2 dates then divide by count

sql oracle average date-difference

I am trying to do (date1 - date2)/ count(date1)

Naming conventions for private members of .NET types

c# .net struct class

Normally when I have a private field inside a class or a struct, I use camelCasing, so it would be obvious that it's indeed private when you see the name of it, but in some of my colleagues' C# cod...