Eclipse and m2eclipse plugin hides parts of folder names - eclipse

How can I stop Eclipse (Helios) and m2eclipse plug-in to hide last dotted part of folder names when importing existing maven projects into workspace?
While importing existing maven projects into workspace, that window where I select the root folder for the import, those folder names are truncated. The last dot separated part of the folder name is removed. If I have lot of folders named like "com.acme.project1", "com.acme.project2" and so on, then Eclipse shows only bunch of folders having name "com.acme". I cannot figure out which one is the correct one without opening Windows Explorer and browsing the same location and checking out real names of those folders.
I'm not sure if that is problem with m2eclipse plug-in or if it is problem with Eclipse. I don't remember seeing that problem with previous Eclipse versions.
Can anybody help? This is really annoying me.

Most likely you have Hierarchical package presentation switched on. On your Package Explorer view, on the top right dropdown switch to > Package Presentation > Flat in order to see com.acme.project1 and com.acme.project2 presented the one under the other in the Package Explorer.

Related

Eclipse is not showing some of my projects

My problem today is that I have 3 Maven projects imported in eclipse, but the soft is only showing one of them.
About the other two:
They don't appear in the package explorer view
They don't appear in the project explorer view, even when I set "Top Level Elements" on "Working Sets".
When I try to re-import them, eclipse tells me it cannot because they are already imported.
Does anyone have any idea ?
You can delete the projects from the metadata folder and try to import them again.
The metadata of the projects is located in:
yourWorkspace.metadata.plugins\org.eclipse.core.resources.projects\
In the end I just deleted my workspace (but not my projects of course) and re-imported everything. I had to reconfigure my entire eclipse but it worked.

Eclipse PyDev: Not working with many files inside project

I am having a data set inside my Eclipse PyDev project that represents about 8 million single .json files. Apparently Eclipse PyDev tries to do something with those files. I'm not sure what Eclipse is doing but it definitely is doing something.
How can I tell Eclipse to leave those files alone and not try to index or parse it because it slowly kills my CPU?
Well, PyDev itself should do nothing with those files, but if there are other plugins (such as EGit) that could explain it...
Anyways, Eclipse itself will at the least index the resources by default.
A workaround here may be dealing with Resource filters: inside the PyDev Package explorer select the parent folder, Alt+Enter to see its properties (or right-click > properties) then select Resource > Resource Filters and add the filter to exclude those .json files.

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 projects not showing up after placing project files in workspace/projects

I've searched for 2 days and can't find anything. I find things that are close, but not what I need.
I got a new computer recently and copied all of my projects over to my new computer.
I opened Eclipse and generated a workspace, which I then closed out of Eclipse and copied my projects into the workspace/projects folder.
I reopen Eclipse and my projects do not show up at all in the package explorer.
I know that I have the correct folders in the correct directory.
The closest thread I found to this is: Eclipse - Import an existing project?
but even that didn't help, my projects already meet that...
I have tried refreshing, reopening, fooling with working sets, etc...
Just because you have a project inside the workspace directory doesn't mean Eclipse opens it or even sees it automatically. You must use File - Import - General - Import existing project into workspace to have your project in Eclipse.
For Juno: (With Source in E:\workspace and destination in C:\workspace)
Copy project directory in its entirety to the workspace directory.
(e.g. Copy E:\workspace\HelloWorld C:\workspace\helloWorld)
Start Eclipse.
Perform: File --> Import
Select: General -- > "Existing Project into Workspace"
"Next >"
Check "Select root Directory"
Select with "Browse Button"
Select "C:\workspace"
A list of existing projects will appear. Just check the ones that are in Bold (To Be Imported) then press the "Finish" button.
Review the Package Explorer and your copied projects should now be there.
This problems comes while .metadata of current workspace has been corrupted due to shut down Eclipse Unexpectedly. So if you face this problem just do the following steps:
Create a new workspace.
Import your existing projects to your new workspace.
you made it!
I had the same problem over and over again the solution that a have found works for now
Close Eclipse.
go to workspace.metadata.plugins
remove org.eclipse.core.resources
Start Eclipse
Do File->Import
General->Existing Projects into Workspace and import all the project from the workspace
Netbeans allows you to do a simple filecopy.
As you know, Eclipse doesn't work like that. You must explicitly "import" files and projects.
If you do import, and if there are no problems, then they should show up.
I'd consider:
a) making a backup of your existing workspace
b) deleting and reinstalling Eclipse
c) Trying another "test import"
You put them in the workspace/projects folder. You should put them directly in the workspace folder and then do an Import Existing Projects into workspace.
in Eclips the Package Explorer
Right click on any viewable project and select Show in -> Project Explorer
Package Explorer -> Right click -> Show in ->Project Explorer
you should be able to see all the imported projects in your Eclipse workspace
Even I had also observed the similar problem. I had closed my eclipse project because of some reason and on restart some of my file added were not visible in explorer even though corresponding file were existing.
Following solution worked for me:
Select whole workspace (Ctrl+A) ==> Righ click and press Refresh.
Or you could try:
Go to File -> Switch Workspace
Select your workspace (if shown)
As I had imported my project from a "git clone", I had to select File->Import-> Git->Project from git -> Existing local repository
Here's a specific problem I ran into when downloading a project from the internet.
Make sure you unzip correctly if it's zipped, you can sometimes get an extra level.
Make sure you place the project in the project file, not directly in workspace.
See if .project and .classpath have been renamed to _project and _classpath. You can't rename them directly so open a text document called .classpath and paste _classpath 's contents in there, saving as all files, not a .txt. _classpath can be opened with notepad.
Import the project from the file workspace. It will look for a folder called projects, your's should be inside it.
Hope this helps :)
The following worked for me.
Create a new project in eclipse.
After creating a new project in
eclipse, right click and select import.
General Import > File System
Select all the folders under your project except the root one. Click
finish.
This would create the required meta data and other internal eclipse project file system which will display your project's files.
You can also import the project directly as a file system. Follow the above steps if you are unable to import it directly.
Hi i also come across same problem, i try many options ,but finally the most easy way is,click of down arrow present inside ProjectExplorer-> customize View->filter-> unchecked close project.
And will able to see all closed projects.
I have tried many of the option suggested but at last importing project in new workspace solved my problem.
I think there is some problem in metadata files in old workspace.
I just wish to add one important detail to the answers above. And it is that even if you import the projects from your chosen root directory they may not appear in bold so you won't be able to select them. The reason for this may be that the metadata of the projects is corrupted. If you do encounter this problem then the easiest and quickest way to fix it is to rid yourself of the workspace-folder and create a new one and copy+paste your projects (do it before you erase the old workspace) folders to this new workspace. Then, in your new worskapce, import the projects as the previous posts have explained.
Yeah.... i kinda see what you need. I just came across same problem.
Here is exactly what i did. Now, bear in mind, this some low level knowledge, since i'm just starting. I made my life complicated, so i needed solution. I kinda found it on my own, using different directions from above answers.
I switched from win 10 on HDD to linux on SSD, so i needed my few of .class and .java imported into new workspace.
First i made a mistake, not using export option on windows and i just simply copied all of files from src and bin folders on win 10 to src and bin folders on linux. Of course workspace did not see those files.
Solution was found in IMPORT tool (which i should have used right away).
I put all of files in src folder into zipp file, and moved this file to some arbitrary folder (Home folder in my case).
Go back to src folder and delete all of .java files (you won't be needing them anymore).
Then i opened my empty project and selected import from File menu in Eclipse.
In import window, under option General (first one) select Import Archive.
Now simply find your zip file, and Voila! All is where it should be.
Problem: After creating a PyDev Project, the project does not show up in "PyDev Package Explorer" ;(
Solution: This is what I do to see them all in "Project Explorer":
I am using Eclipse IDE 2019-12
click on "Resource" icon at the top right corner
Now you shall see all projects show up in "Project Explorer".
Tricky note: now if you click on "PyDev" icon, you will see less projects show up in "PyDev Package Explorer" Magic?
What I did wrong about it, I used "import" - > "Projects from Folder or Archive" because I thought it would be the same thing. You have to use "Existing Projects into Workspace". Maybe this helps someone.
I experienced the same issues and I just click on Window -> Show view -> then Project explorer.
Then I got my project that was inside my eclipse workspace.

Eclipse showing package name including directory structure

I have my source in the hierarchy:
folder: src/main/java
package: com.test.serviceImpl
Now eclipse is showing this as src.main.java.com.test.serviceImpl
How can I make it display only com.test.serviceImpl under the directory structure : src/main/java
Note: This is a maven project module imported to eclise. All other modules display properly
If you use m2eclipse and your pom is configured properly, just right-click the project and select Maven > Update Project Configuration.
If that doesn't work, study the Eclipse Maven Console (in the Console view) for errors.
Set src/main/java as a source root directory.
Here's the standard Maven directory structure - like it or not:
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
I had a problem which may be related.
Eclipse started showing folder names as a concatenation of the folder name with other elements. A folder named "x" was being replaced with "xorg.eclipse.jdt.core.javabuilderorg.eclipse.m2e.core.maven2builder"
After exploring various possible explanations and/or solutions, I realized this behavior appeared after my having deleted a project folder without checking the box "Delete project contents on disk (cannot be redone)". When I subsequently re-checked out the code from an SVN repository, a folder named "x" was still on my disk, and so I suspect Eclipse created a longer version of a folder to contain "x" using other elements from the buildSpec.
I fixed the problem by closing Eclipse, deleting both folders ("x" and "xorg.eclipse..."), reopening Eclipse and checking out the project again.
I had the same problem on my Maven project and I solved it just updating my project Maven>Update Project