I am trying to create a project that depends on the JDT core . I used the records in the center of Maven until I realized that they were outdated for several years . After joking a bit, I came across https://repo.eclipse.org . I found the repository I needed and added it:
<repository> <id>eclipse</id> <name>Eclipse Repository</name> <url>https://repo.eclipse.org/content/groups/eclipse/</url> </repository> ... <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>org.eclipse.jdt.core</artifactId> <version>3.10.0.v20140316-0146</version> </dependency>
But then I started getting the error:
The type org.eclipse.core.runtime.IProgressMonitor cannot be resolved. This indirectly refers to the required .class files
I managed to find the type in one of the Nexus repositories and added it:
<repository> <id>eclipse-acceleo</id> <name>Eclipse Repository</name> <url>https://repo.eclipse.org/content/groups/acceleo/</url> </repository> ... <dependency> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.common</artifactId> <version>3.6.200.v20130402-1505</version> </dependency>
Now i get an error
The type org.eclipse.core.runtime.Plugin cannot be resolved. it indirectly refers to the required .class files
And I cannot find the class in any of the Nexus repositories. org.eclipse.jdt.core.JavaCore is a class that references org.eclipse.core.runtime.Plugin .
1. What dependency do I need to add to enable org.eclipse.core.runtime.Plugin ?
2. Is there a better way to make JDT dependent on Maven?
/ e1
I found org.eclipse.core.runtime.Plugin using http://grepcode.com . This time, the updated dependency is in Maven Central (and not in the Eclipse Nexus repo):
<dependency> <groupId>org.eclipse.core</groupId> <artifactId>runtime</artifactId> <version>3.9.100-v20131218-1515</version> </dependency>
Now, when I try to run my tests, I get the following exception everywhere:
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IResource at org.eclipse.jdt.core.dom.ASTParser.<init>(ASTParser.java:177) at org.eclipse.jdt.core.dom.ASTParser.newParser(ASTParser.java:126) . . . Caused by: java.lang.ClassNotFoundException: org.eclipse.core.resources.IResource at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 30 more
At this point, I plan to download the full JAR and add it as a system dependency. Is there a better way to add JDT to Maven dependency?
java eclipse maven eclipse-jdt
Jeffrey
source share