-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntelliJ IDEA support #1054
Comments
It heavily depends on you project setup, but given you have a multi-module project with a common parent/aggregator it should be called on these projects. If you call it on a single one it must work to call mvn at exactly this folder stand alone. If not you can again use |
Hi @laeubi, thanks for the quick answer. But anyway
Are you referring to all the non-parent projects?
I think this should not be required so I'll leave this solution aside for now. |
Beside the demos, there are also a lot of integration test that could be used as an executable example.
Then IntelliJ must be "smart enough" to compute the set of required projects itself :-)
In a very simplified fashion Tycho works this way:
So if you just run it on one project A, there might be the problem that you need also project B+C but Tycho (or more specifically maven) won't know about them and the build fails. So either this one project must be self-contained (most probably not the case for any non trivial example), you need to know the required projects in advance (hard to guess for any non trivial example), or you use the tycho-build extension with As an alternative one can always build "all" projects (where all of course could be a subset of all possible maven projects in a given code repository). Just another note: Its actually that ItelliJ do not support PDE than it not support Tycho as Tychos primary intend is to build PDE Artifacts with Maven so Eclipise is actually not using Tycho to build such a project! |
Ok I'll try to wrap my head around what you wrote, thanks 😄 |
Automatic dependency resolution is what PDE does, so no Tycho there either (this is performed by P2). Just let me know when anything is unclear. |
@laeubi so what you're saying is that I could run Maven via command line and then use the standard PDE support in IntelliJ? |
I don't know much about IntelliJ PDE support to guess if that works, but what I wanted to say is that any Plugin that claims to support PDE, should also support automatic dependency resolution based on a target platform and the manifest data. Otherwise it does not really supports PDE, but probably can read/write some of its meta-data :-) |
@laeubi oh ok! I mean, the plugin I linked supports reading the target configuration file and the manifest, and is capable of generating the correct IntelliJ module structure (I have used it for a big RCP application). Being that Tycho is basically an extension to Maven, IntelliJ tries to setup the project using Maven, but fails. |
Alright, maybe then one should instruct InteliJ to not try using it as a maven project? I don't know how InteliJ setup the maven world, at laest you can do some testing yourself by issuing |
By the way, currently there is a special property passed by m2e to a maven build that is read by Tycho to skip the extension in that case, is there also such property for intelij? Please don't use tycho.mode=maven as it is legacy and sceduled for removal: |
I'm doing some progress with debugging the demo project.
And the P2 resolver uses some suffixes to look into the repository However it cannot resolve it. Any idea what I'm missing? |
What is the exact error? Can you run the project on the command-line with |
Yes it works 👀
|
Have you tried letting the code go on? Repositories are sadly queried on "best guess" sometimes and some failures are allowed, do you see the info print outs also in IntelliJ? |
It seems like there is no
|
I don't know how the InteliJ maven server works, but this seems something is not loaded/isolated as it should. Tycho start an internal OSGi Framework currently so if intelliJ reuses classloaders and/or mess up classpath you are maybe out of luck then.... but you can use |
Got to the original error:
It seems there are two conflicting versions of SLF4J. Sad 😢 |
This might indicate the IntelliJ do not properly isolate class realms for extensions here. |
@laeubi yeah, probably. Do you think workarounds exists for this issue? Like for example manually loading the same class files in the |
Not really, maybe IntelliJ is missing the core-exports are missing here but that's hard to guess without deeper knowledge of that code. But I think you now have a good test-case for the IntelliJ people to investigate further on this issue. |
To be fair, IJ isn't doing anything improperly, it's not OSGi based. So different trade-offs. As far as I know they IJ is based on pico container in regard of plugins. |
@bric3 that has nothing to do with OSGi or PicoContainer, the Tycho extension is starting an embedded OSGi framework (Maven itself do not use OSGi in any way...) and exports some stuff from its class realm into this framework, so if the classrealm is not setup property such issues can arise. |
@bric3 so there is a little difference here regarding how IntelliJ spawns the Maven server. It's not really a plugin, but it seems a new instance of the JVM is created. Also I see some code related to realms. |
Ah ok i understand your point, thanks for the clarification. |
I'm trying out again IDEA.
The repository has been defined under
Why is Equinox looking for a |
Nexus has a known bug with producing wrong P2 Metadata, so you probably ant to check with an official repository first. |
@laeubi in the end it was still related to
What I'm doing now is use offline |
Then something seems wrong with how intelij setup the classpath for the plugin. |
@laeubi yep! We had already discussed about this maybe a month ago. This time I wasn't immediately able to capture the internal Equinox classloader exception, so I thought it started working. |
The so-called "Eclipse PDE Partial IDEA Plugin" seems to be not related to Eclipse PDE at all, but to be just a fake not based on Eclipse PDE, missing basic Eclipse PDE functionality, violating both trademarks, Eclipse® and PDE™. I've seen a couple of Stack Overflow questions showing that people have wasted a lot of time with this. You as an author of the so-called "Eclipse PDE Partial IDEA Plugin" should know that. |
@howlger I can't tell anything about that plugin becuase I don't use it but @lppedd don't seem to be the author but a contributor to the project (mostly: formatting if I get ti right): https://github.com/JaneWardSandy/eclipse-pde-partial-idea/commits?author=lppedd |
@howlger I have no idea how the plugins works internally, as I'm not the author. I know it reproduces some of its functionalities, e.g. the Target Platform, and provides inspections to warn about wrong usages of packages. |
This happens if you don't know the scope of that plugin. It doesn't try to reproduce PDE in its entirety, it does try to allow dependency resolution in the context of IntelliJ IDEA. I think this is out of scope for this issue tho. |
To be clear, @lppedd is not a committer and therefore not the author (not responsible for the naming), but a contributor and therefore an author with some knowledge how it works. I doubt that your claim that "IntelliJ supports PDE" is true. It looks to me like that the IntelliJ plugin you mentioned is not a partial Eclipse PDE, but something that is 0% Eclipse PDE just trying to fake some Eclipse PDE features. If so, that would be unfair, both to the users who are being fooled by the name wasting their time and to the Eclipse PDE project. It's unclear why you reported this issue to Tycho. How can the problem that IntelliJ IDEA does not support Maven plugins like Tycho be solved by Tycho? |
This was meant is a way to track progress, plus as a way to get help from @laeubi if possible. We can convert this to a discussion if it makes it not a problem anymore for you. |
And a personal note, I successfully used the plugin to develop a PDE-based RCP application. |
Well that's obvious I'd say.
To be fair I'd only thank people trying to (fake) support PDE on other IDEs. I'll repeat myself: if you don't like the name, ask for it to be changed, but ask that to whom has the power to do it. On my side I can't do anything more. I patched IJ to support Tycho, I think my work is done |
Would you mind adding a new section to https://github.com/eclipse-tycho/tycho/wiki that explains how Tycho can be used with InteliJ? |
I can do it, but I think it's still not the time. For reference, to get Tycho on IJ a "personal" Community build is necessary as of now.
When I'll have more free time I'll implement what's described in the PR, and maybe the PR will be mergeable. |
@lppedd I didn't say I dislike the name, and I didn't say I'm against supporting development of Eclipse plugins in other IDEs. Do not make conclusions from something I didn't say. Please discuss this with others. I'm not okay with people using a borrowed name and fooling others into wasting their time. I wish people would value the work of others and trademarks were not even needed. I know the plugin you mentioned only from Stack Overflow questions showing conceptual problems of this plugin and some reasons for dogfooding. |
The way it was phrased in the earlier comment led me to the same conclusion as @lppedd, thanks for the clarification.
I don't see the problem in that, I discovered this problem because it has exactly the key words I was searching : "Eclipse" "PDE". Also no one else was doing a similar work to begin with, i.e. to enable the development of Eclipse based applications or plugin using IntelliJ IDEA, and clearly I'm thanking a lot the main author of this plugin for this work he did mostly alone. |
@howlger well you came in pretty aggressively with trademark violation allegations towards me, just because I mentioned a plugin you found to have issues. I take trademark seriously like you and if there is a problem on that level it should be solved.
How do people lookup PDE support in IntelliJ? Searching "Eclipse PDE IntelliJ". |
I get the same error when executing a tycho build via
The problematic slf4j dependency seems to be necessary, otherwise you don't get any output from maven. |
None of this is true. What exactly make you say this? Please read the Community Code of Conduct. I wrote "seems to be" as a reply to a claim of yours that I doubt. I don't even want to take my time to find out whether trademarks are actually being violated or not. If you take it as seriously as I do, then you don't care at all. ;) |
While there's a disagreement on the way things were written, let's stop discussing this matter here as it does not help the case at hand, i.e. having IntelliJ IDEA support of Tycho based maven projects. |
Tycho 3.0.0-SNAPSHOT seems to work 👍, maybe because of this? Lines 122 to 123 in fe99a12
|
Just to align the Tycho guys, version 4.0.0 doesn't work anymore with IDEA, at least the SNAPSHOTs.
Did something change in the handling of Equinox dependencies? |
For completeness, this is the errors I get from the debug log.
|
getService(Class key) is a default implemented interface method. |
@laeubi hi! Yup I checked. But it was added in equinox.p2.core 2.6. I suspect it's loading an old version of equinox p2 for some reason. Where do you specify the version constraints? E.g. I want only 2.9+. |
Hi all!
I'm currently trying to understand why Tycho isn't working in IntelliJ IDEA, testing with https://www.eclipse.org/mat/.
(see also issue https://youtrack.jetbrains.com/issue/IDEA-186628)
I have managed to debug the IDEA Maven implementation, and this is the call stack just before a dependency is not found.
At this point
DependencyHelper#hasASolution
returns false.Tycho gets called as a Maven extension, via
AbstractMavenLifecycleParticipant#afterProjectsRead
Question is, how should it be called? Which projects should be passed in the session? One at a time? All?
I'm a bit ignorant on how Tycho works so I'm sorry if my question seems a bit stupid.
The text was updated successfully, but these errors were encountered: