1

I haven't worked with Java in many years as I primarily work with PHP (Using Composer for dependency management). I've only just started looking at Maven and Gradle too.

I'm trying to have a play around using Maven and wanted to use Eclipse's JDT UI tools so I could have a go at a test project building a user interface using some of their components, just to try and bring myself up to speed.

I'm using Maven to try and bring in the JDT UI package as a dependency. This is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.jonathon</groupId>
    <artifactId>ui-test</artifactId>
    <version>1.0-SNAPSHOT</version>


    <dependencies>
        <dependency>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>org.eclipse.jdt.core</artifactId>
            <version>3.12.2</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>org.eclipse.jdt.ui</artifactId>
            <version>3.12.2</version>
        </dependency>
    </dependencies>

</project>

I'm using IntelliJ IDEA as my IDE and it seems to be complaining in a tooltip about not being able to resolve dependencies. I tried running mvn compile to see if I could get a better error message and I got this:

[ERROR] Failed to execute goal on project ui+test: Could not resolve dependencies for project com.jonathon:ui-test:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.eclipse.jdt:org.eclipse.jdt.ui:jar:3.12.2 -> org.eclipse.platform:org.eclipse.search:jar:3.11.1 -> org.eclipse.platform:org.eclipse.ui:jar:3.108.1 -> org.eclipse.platform:org.eclipse.swt:jar:3.105.2 -> org.eclipse.platform:org.eclipse.swt.gtk.linux.aarch64:jar:[3.105.2,3.105.2]: No versions available for org.eclipse.platform:org.eclipse.swt.gtk.linux.aarch64:jar:[3.105.2,3.105.2] within specified range -> [Help 1]

Am I doing something wrong? I got the artifactId, groupId and version from here.

Jonathon
  • 15,873
  • 11
  • 73
  • 92
  • try running mvn update -U, look in your .m2 folder, you probably wont find the missing jars, they should be there when you do an update – derek Aug 15 '17 at 23:27
  • There's a related question here: https://stackoverflow.com/questions/12651959/maven-build-error-no-versions-available-for-org-codehaus-jacksonjackson-core-as#12669345 – Gus Aug 15 '17 at 23:41
  • You need to do some research on Maven and OSGI development because the normal Maven process does not really apply. Typically, Eclipse dependencies (which are `bundles` rather than `jars`) are acquired from P2 repositories rather than the central repo. – Steve C Aug 16 '17 at 02:47
  • Thanks for your replies. @SteveC I've done a little reading into OSGi and I think I can understand why it's not working now. Would I be correct in thinking I would have to develop an OSGi application and "slot in" the Eclipse components as bundles rather than pull them in as dependencies and work with/extend them? Is there any way I could perhaps pull in Eclipse's editor (With syntax colouring etc.) without OSGi? – Jonathon Aug 16 '17 at 16:55

1 Answers1

1

This library is the problem org.eclipse.platform:org.eclipse.swt.gtk.linux.aarch64:jar it doesn't exist at all.

gtk.linux.aarch64 this part is resolved from your setup or java/system

propably you need to set osgi.platform=gtk.linux.x86_64 in your mvn pom or env .

John Tribe
  • 1,407
  • 14
  • 26