Using JDT as dependency in a project

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using JDT as dependency in a project

Sebastian Kürten
Hello,

as so many projects rely on the Eclipse formatter for formatting their
source code, I find it fundamental to be able to run the Eclipse
formatter programatically. I found this[1] section in the JDT
Programmer's Guide that explains how to do that.

I'm able to use that approach in a plain Java project (not an Eclipse
plugin) by including the Maven dependency
'org.eclipse.jdt:org.eclipse.jdt.core:3.10.0' in my project, which can
be resolved from Maven Central.

This is however a very old version which does not work the same way
Eclipse Mars or Neon does. Searching through the web, I found a
separate Maven repository[2], that contains a much more recent version
'org.eclipse.jdt:org.eclipse.jdt.core:3.13.0.v20160913-0926' of that
artifact.

That artifact can't be used however, because it does not contain proper
references to its dependencies such as 'org.eclipse.text' and others.
The result ist that the CodeFormatter's format() method returns a
reference to TextEdit that cannot be resolved.

Is there some other Maven repository with recent versions of the JDT
libraries somewhere that I am missing or is it just impossible to use
JDT in simple Java projects?

Thanks,
Sebastian

[1]
http://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_codeformatter.htm?cp=3_0_0_8
[2]
https://repo.eclipse.org/content/repositories/eclipse

_______________________________________________
jdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using JDT as dependency in a project

Jayaprakash Arthanareeswaran
The version you found, 3.13 is the right one.
 
> That artifact can't be used however, because it does not contain proper
> references to its dependencies such as 'org.eclipse.text' and others.
 
Can you elaborate more on this? This could probably be due to org.eclipse.text not being hosted in that repo?
Is there any other dependency that is failing too?
 
Jay
----- Original message -----
From: Sebastian Kürten <[hidden email]>
Sent by: [hidden email]
To: [hidden email]
Cc:
Subject: [jdt-dev] Using JDT as dependency in a project
Date: Mon, Oct 17, 2016 11:54 PM
 
Hello,

as so many projects rely on the Eclipse formatter for formatting their
source code, I find it fundamental to be able to run the Eclipse
formatter programatically. I found this[1] section in the JDT
Programmer's Guide that explains how to do that.

I'm able to use that approach in a plain Java project (not an Eclipse
plugin) by including the Maven dependency
'org.eclipse.jdt:org.eclipse.jdt.core:3.10.0' in my project, which can
be resolved from Maven Central.

This is however a very old version which does not work the same way
Eclipse Mars or Neon does. Searching through the web, I found a
separate Maven repository[2], that contains a much more recent version
'org.eclipse.jdt:org.eclipse.jdt.core:3.13.0.v20160913-0926' of that
artifact.

That artifact can't be used however, because it does not contain proper
references to its dependencies such as 'org.eclipse.text' and others.
The result ist that the CodeFormatter's format() method returns a
reference to TextEdit that cannot be resolved.

Is there some other Maven repository with recent versions of the JDT
libraries somewhere that I am missing or is it just impossible to use
JDT in simple Java projects?

Thanks,
Sebastian

[1]
http://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_codeformatter.htm?cp=3_0_0_8
[2]
https://repo.eclipse.org/content/repositories/eclipse

_______________________________________________
jdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-dev

 
 


_______________________________________________
jdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using JDT as dependency in a project

Sebastian Kürten
Yes, that artifact is indeed not hosted in that repo. If you browse[1]
through the repo, you can see that it contains only three artifacts of
the "org.eclipse.jdt" group, namely:

* org.eclipse.jdt.annotation
* org.eclipse.jdt.compiler.apt
* org.eclipse.jdt.core

I'm not able to tell which dependencies are failing, because the POM
file[2] is kind of broken, too. It does not declare any dependencies at
all, while it definitely has depdendencies. (I can tell because of the
missing class TextEdit)

[1] https://repo.eclipse.org/content/repositories/eclipse/org/eclipse/jdt/
[2] https://repo.eclipse.org/content/repositories/eclipse/org/eclipse/jdt/org.eclipse.jdt.core/3.13.0.v20160913-0926/org.eclipse.jdt.core-3.13.0.v20160913-0926.pom

On Tue, 18 Oct 2016 09:15:59 +0000
"Jayaprakash Arthanareeswaran" <[hidden email]> wrote:

> The version you found, 3.13 is the right one.
>  
> > That artifact can't be used however, because it does not contain
> > proper references to its dependencies such as 'org.eclipse.text'
> > and others.
>  
> Can you elaborate more on this? This could probably be due to
> org.eclipse.text not being hosted in that repo? Is there any other
> dependency that is failing too?
> Jay
> ----- Original message -----
> From: Sebastian Kürten <[hidden email]>
> Sent by: [hidden email]
> To: [hidden email]
> Cc:
> Subject: [jdt-dev] Using JDT as dependency in a project
> Date: Mon, Oct 17, 2016 11:54 PM
>  
> Hello,
>
> as so many projects rely on the Eclipse formatter for formatting their
> source code, I find it fundamental to be able to run the Eclipse
> formatter programatically. I found this[1] section in the JDT
> Programmer's Guide that explains how to do that.
>
> I'm able to use that approach in a plain Java project (not an Eclipse
> plugin) by including the Maven dependency
> 'org.eclipse.jdt:org.eclipse.jdt.core:3.10.0' in my project, which can
> be resolved from Maven Central.
>
> This is however a very old version which does not work the same way
> Eclipse Mars or Neon does. Searching through the web, I found a
> separate Maven repository[2], that contains a much more recent version
> 'org.eclipse.jdt:org.eclipse.jdt.core:3.13.0.v20160913-0926' of that
> artifact.
>
> That artifact can't be used however, because it does not contain
> proper references to its dependencies such as 'org.eclipse.text' and
> others. The result ist that the CodeFormatter's format() method
> returns a reference to TextEdit that cannot be resolved.
>
> Is there some other Maven repository with recent versions of the JDT
> libraries somewhere that I am missing or is it just impossible to use
> JDT in simple Java projects?
>
> Thanks,
> Sebastian
>
> [1]
> http://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_codeformatter.htm?cp=3_0_0_8
> [2]
> https://repo.eclipse.org/content/repositories/eclipse
>
> _______________________________________________
> jdt-dev mailing list
> [hidden email]
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jdt-dev 
>  
>
_______________________________________________
jdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-dev