Eclipse shows package name including directory structure

I have a source in the hierarchy:

folder: src / main / java package: com.test.serviceImpl

Now eclipse shows this as src.main.java.com.test.serviceImpl

How can I make it display only com.test.serviceImpl in the directory structure: src / main / java

Note. This is a maven project module imported into eclise. All other modules are displayed correctly.

+6
source share
4 answers

Set src/main/java as the 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

+1
source

If you use m2eclipse and your pom is configured correctly, simply right-click on the project and select Maven > Update Project Configuration .

If this does not work, check out the Eclipse Maven console (in the Console view) for errors.

+5
source

I had a problem that could be related.

Eclipse started showing folder names as a concatenation of the folder name with other items. Folder named "x" replaced by "xorg.eclipse.jdt.core.javabuilderorg.eclipse.m2e.core.maven2builder"

After studying various possible explanations and / or solutions, I realized that this behavior appeared after I deleted the project folder without checking the "Delete project contents on disk (cannot be redone)" box. When I subsequently re-checked the code from the SVN repository, a folder named "x" was still on my disk, and therefore I suspect that Eclipse created a longer version of the folder containing "x" using other elements from buildSpec.

I fixed the problem by closing Eclipse, deleting both folders ("x" and "xorg.eclipse ..."), opening Eclipse again and checking the project again.

0
source

I had the same problem in my Maven project and I decided it was just updating my Maven project> Update Project

0
source

Source: https://habr.com/ru/post/891825/


All Articles