Starting with IntelliJ - Dependency manager like in Eclipse? - eclipse

I'm new to IntelliJ IDEA and I was looking for some plugin that allows me an easy dependency management like this (look at the picture below) to easily add/remove dependencies. I have not found anything at all. Maybe someone of you know about any plugin.
Image Link: Eclipse pom.xml dependency manager
It is really important for me since I add/remove dependencies a lot and it really takes a lot of time to copy it from the internet, checking if it's the latest version and etc.

There is no such view in IDEA.
You can add a dependency like so: https://www.jetbrains.com/help/idea/2016.2/generating-maven-dependencies.html
Open the desired pom.xml file for editing.
With the editor tab having the focus, choose Code | Generate on the main menu, or press Alt+Insert, and choose Dependency from the Generate pop-up window.
Viewing all dependencies as a diagram is described here: https://www.jetbrains.com/help/idea/2016.2/working-with-maven-dependencies.html
Do one of the following:
In the Maven Projects tool window, right-click the desired sub project or a package, and choose Show Dependencies, or Show Dependencies Popup.
Right-click pom.xml in the editor, and choose Dependencies | Show Dependencies /Show Dependencies popup.
I agree that the Eclipse way looks nicer.
You can file a feature request here:
https://youtrack.jetbrains.com/issues/IDEA
Let me know if you have done so. I'll vote for it.

Related

How to find the execution steps of an Eclipse plugin project

I am using Eclipse JUNO IDE in which I have imported an eclipse plugin project.
When I execute the project, a new copy of the eclipse window is opened and the plugin is displayed in the File Menu as "New Sample Project" in between the "New" option and "Open File" option. The plugin works normally.
From this project I wanted to know which file executes first and how the execution proceeds.
While this is the way to find the order of execution of a simple java program, is there a way to find the code execution order of a plugin project, which has many packages and each package has many java files?
I am new to eclipse plug-in development. Please help
Eclipse plugin project is different than normal Java project and also its execution.
Before jumping into execution steps, I think you better go through plugin project Manifest file details. It will give you overview of plugins that are contributed into your new eclipse instant and their implementation class in project.
Go through different tab in the manifest file. I will brief some of important things for you:
Overview: General info of you plugin. In general information section you will find Activator, which points your activator of plugin which will load your plugin.(You can say it as starting point as it controls plugin life cycle but not clearly starting point)
Dependencies: Plugins required and on which your projects are depended.
Extension: Here you will add Extension Points required for your plugin like view, editor, action,command. Here you can see overview of things which will be contributed through your plugin project.
Hope this helps.

Easy way to find which Eclipse version and plugins are needed for existing Eclipse project

I was given a working Eclipse project in Java. If I open it in some version of Eclipse then I get numerous errors. I get them because my version of Eclipse differs (it is not web developer) and vaadin and ivy plugins were used to create the project. How can I understand which version of Eclipse and which plugins are needed? I can get some sense by looking in .setting folder. There are a lot of files with names as namespaces related to plugins. Is there more direct or automatic/semi automatic way to find which plugins and Eclipse version are needed?
No. The Eclipse developers expect you to know your tools and if you take over a project from someone else or join a project, that someone explains to you how to install and configure Eclipse.
To find out which Eclipse plugins you need, look into the file .project and the folder .settings. Google for the file names and plugin IDs to see what they might mean. Usually, the third word of the name is the project (org.eclipse.jdt.* -> JDT project).
For missing classes, you need to look at the classpath. The easiest way to do that is to right-click on your project name and then select "Properties" from the menu. There is an entry "Build Path" which contains all the dependencies. Click through the tabs to see what you need.
For plugin projects, look into the file META-INF/MANIFEST.MF; Eclipse should open a special editor when you open it which has a tab for dependencies.

Eclipse - How to open and set breakpoints in code attached to the target platform plugins?

I am a newbie to Eclipse. I have some plug-ins installed in my eclipse workbench along with their source plugins (thus i have attached code with these plugins).
How can I open(and view) the source code of these installed plugins and set break-points so that I could debug these plug-ins?
My motive behind this task is to get a deeper understanding of the source code of some of these plug-ins.
Though the post How to set a breakpoint in Eclipse in a third party library? explains some methods, it doesn't tell how to open and view the attached source code.
Thanks in advance.
If you only need breakpoints, use Ctrl-Shift-T (Open Type), enter the name of the class and set the breakpoints.
But if you really want to learn about the plugin in question, there is more: Open PDE perspective, there is a view "Plugins". Select the plugin you are interested in, choose Import->As Source from the context menu of the plugin. This imports the plugin into your workspace, so you can really investigate all artifacts inside, not only the source. By default, your launch configuration will use the plugins from the workspace as first choice, so you can even modify that imported plugin now and see the effects when running your workspace.

multi module maven project structure in eclipse

I have two modules under a main project
main
|
|
--module-a
|
|
--module-b
I created it using eclipse->new ->Maven project, eclipse->new->maven module.
The structure in the file system looks correct. But in eclipse, it shows module-a, module-b as two new projects in the package explorer.
My main project looks like this.
I have seen few multi module projects where, the modules are present within the main project in package explorer. The main project had
module-a/src/main/java
module-a/src/test/java
module-a/src/resources/java
module-b/src/main/java
module-b/src/test/java
module-b/src/resources/java.
How do I convert my project to look like this ?
Starting from Eclipse 4.5.M5 (that you can already download at http://eclipse.org/downloads ), the Project Explorer view has a parameter to show projects hierarchically, to better handle such case. See https://www.eclipse.org/eclipse/news/4.5/M5/ for details.
You will find if you navigate the actual file system (oe use the 'navigator' view in eclipse) that the sub modules do in fact exist underneath the main parent project folder.
Eclipse is nice enough (clever enough or whatever) to pull them out when you use the 'package explorer' view. I guess this makes it easier to find and navigate your way aournd a highly modular project.
However if you set up your Parent POM correctly you can have a flat structure to your modular project if you so desire (I haven't as yet been able to get this to work, so far I think it is related to the sub module classpaths or something?).
David.
I solved this problem as follows:
Under the "Project Explorer" click on the "View Menu" (little triangle) and select "Filters and Customization..."
Under the "Content" tab tick "Nested Projects"
Finally, Under the "Pre-set filters" tab tick "Nested Projects: hide folders when projects is shown as nested" and "Nested Projects: hide-top-level project if shown as nested".
By doing that I come up with the following structure.
I used a Spring Tool Suite 3: Version: 3.9.11
Basically, Eclipse does not support the Maven way of structuring projects.
By using the M2E it is possible to execute Maven as part of the build, but that way you lose the project management and incremental build capabilities of Eclipse.
You can also simply use the Eclipse layout in the IDE, and build with Maven in the build server, but that way you have to make sure the two build are identical.
I have seen few multi module projects where, the modules are present
within the main project in package explorer.
Thats what do maven eclipse plugin. It just create single project with multiple source directories for each module of maven multimodule project.
If you want to see some hierarchical structure in eclipse - use working sets. Create working set with name of parent, add module-a and module-b to it and visually it will be separated from other projects in eclipse workspace.
You can do this in earlier versions of eclipse as well. Close and Remove the sub-module projects (as they are already present in the parent folder). Now click on Properties on the main project -> Project Facets -> Convert to faceted form. This will detect Java automatically, Click on Apply, OK. Now you can see that these modules are created with Source folders

eclipse debugger: attaching source-code of maven dependencies?

I'd like to use the source code of maven-managed dependencies when debugging our webapp in myEclipse 8.
I have managed to attach the sources to the libraries in the "Maven Managed Dependencies" classpath container, i.e. when I open a class file from a dependency (e.g. using Ctrl-Shift-T), I see the source code.
However, when I define a server connector for my tomcat, deploy the wepapp to it, and launch it in debug mode and execution halts on a breakpoint in that same class, the editor pane only displays the text "source not found", and a button to edit the "source lookup path". I have attempted to manually add the "Maven Managed Dependencies" classpath container, only to be told "Use maven project settings to configure depedency resolution". However, I see no useful setting in that property pane ...
How can I attach those sources? I am aware that this works with the m2e plugin and wtp, but I'd rather avoid convincing the rest of my team to switch plugins ...
Looks like issue MNGECLIPSE-983
I have confirmed that if I manually pick the External Archive option and find the relevant -sources jar (navigating that big .m2/repository tree to find it) and then add the jar as a sources it does work, and surprisingly it does remember the next time which isn't too bad.
That's at least doable I think for me because we don't often need to step debug through external dependencies, but when we do, it's often frequent, so adding it once while a bit of a pain, can be done on a case by case basis.
I have since discovered that this problem only occurs if the server is launched using a launch configuration.
The problem does not occur if the server is started by:
click the server icon in the toolbar -> context menu appears
mouse over the intended server -> submenu appears
click on "Start"
While this precludes sharing the server configuration by checking the launch configuration into version control, it at least allows seamless debugging.
Please do the following steps in Eclipse IDE(Tested with Version: 3.5.2),
In Package Explorer, Right Click on the Project which integrated with Maven container.
Select Maven 2 and then select "Fetch Source JARs".
The above action wil fetch sources of all the 3rd party jars present in the Maven Classpath.
Regards,
Rajesh.
Just put the .m2/repository/ folder itself with the search subfolders option.