Question

I am creating an Eclipse plug-in that requires the use of JGit. However, I am not sure how to import the bundle as a dependency.

When I try to build with tycho I am greeted with errors about being unable to resolve the dependency. I have tried adding a dependency in the pom:

    <dependency>
        <groupId>org.eclipse.jgit</groupId>
        <artifactId>org.eclipse.jgit</artifactId>
        <version>3.2.0.201312181205-r</version>
    </dependency>

Adding the bundle to Required-Bundles in the manifest:

But all efforts lead back to being unable to resolve the dependency:

org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: No         solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.inin.testing.eclipse.plugin.submit 0.5.0.qualifier to bundle org.eclipse.jgit 3.2.0.; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.0.v_OTDT_r220_201306071800 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.1.v_OTDT_r221_201309101918 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; No solution found   because the problem is unsatisfiable.]

If anyone has had success using the JGit library in an eclipse plug-in project let me know how you are consuming it.

Was it helpful?

Solution

If you are working with PDE, JGit (or other dependencies) is best consumed through a Target Platform.

The definition below integrates JGit 3.2 from the projects' software repository at Eclipse.org.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="JGit" sequenceNumber="53">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jgit.feature.group" version="3.2.0.201312181205-r"/>
<unit id="org.eclipse.jgit.source.feature.group" version="3.2.0.201312181205-r"/>
<repository location="http://download.eclipse.org/egit/updates"/>
</location>
</locations>
</target>

Paste the snippet into a file within your workspace and open it with the (default) Target Definition Editor. Select the 'Set as Target Platform' link in the top-right corner. This will download JGit along with required bundles and make them your current target platform.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top