Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Mars shows source folder multiple times
Mars shows source folder multiple times [message #1710135] Mon, 05 October 2015 03:26 Go to next message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
Hello,

I have a simple maven project where eclipse shows the source folder multiple times.
See attached image:

index.php/fa/23453/0/

The project was created like this:
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart


Then, I created the eclipse project file like this:
mvn eclipse:eclipse


In eclipse, I imported it as an existing project.

Project and package presentation is set to "hierarchical".

What can I do to remove the multiple occurrences of the source folder?

Thanks
Magnus
  • Attachment: eclipse.png
    (Size: 29.44KB, Downloaded 2343 times)

[Updated on: Mon, 05 October 2015 03:27]

Report message to a moderator

Re: Mars shows source folder multiple times [message #1710282 is a reply to message #1710135] Mon, 05 October 2015 16:56 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Did you notice that the icons on src/test/java and src/main/java differ from the icon on src? That's because you don't actually have src set as a source folder. Instead, the java folders under src/test and src/main are set as source folders.

Simple solution to the immediate problem: right-click on the src folder, then select Build Path -> Use as Source Folder.

That might be bad, though, if you have other things in src or src/test or src/main besides java source code. You may have to look at restructuring the project a bit.
Re: Mars shows source folder multiple times [message #1710286 is a reply to message #1710282] Mon, 05 October 2015 17:15 Go to previous messageGo to next message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
Hi Erick,

well, this project was newly generated by maven.
I cannot understand why it must be restructured or why you have to set the source folder...

Could it be that "mvn eclipse:eclipse" is not working properly?

Magnus
Re: Mars shows source folder multiple times [message #1710298 is a reply to message #1710286] Mon, 05 October 2015 20:06 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Perhaps everything is working properly, and it just looks funny?
Re: Mars shows source folder multiple times [message #1710306 is a reply to message #1710298] Mon, 05 October 2015 23:16 Go to previous messageGo to next message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
But four times App.java isn't funny. Isn't there another eclipse forum where someone could explain this? I feel that I'm wrong here...
Re: Mars shows source folder multiple times [message #1710367 is a reply to message #1710306] Tue, 06 October 2015 09:12 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Are you on GTK? Then this might be a GTK3 issue try setting SWT_GTK3=0
in your env before launching.

Tom

On 06.10.15 01:16, Magnus Warker wrote:
> But four times App.java isn't funny. Isn't there another eclipse forum
> where someone could explain this? I feel that I'm wrong here...
Re: Mars shows source folder multiple times [message #1710443 is a reply to message #1710367] Tue, 06 October 2015 16:51 Go to previous messageGo to next message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
$ export SWT_GTK3=0; eclipse


No change...
Re: Mars shows source folder multiple times [message #1710600 is a reply to message #1710443] Wed, 07 October 2015 19:34 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
This indeed looks bogus.
To find out whether "mvn eclipse:eclipse" created a bogus configuration, you may want to show us your .project and .classpath files.
If those are kosher, then this view has a bug. BTW, you may want to compare how this is rendered in "Package Explorer" vs. "Project Explorer": Do both views show the same?

Stephan
Re: Mars shows source folder multiple times [message #1711433 is a reply to message #1710600] Fri, 16 October 2015 03:54 Go to previous messageGo to next message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
Hello,

here are for comparison both views, project explorer and package explorer:

Project Explorer:
index.php/fa/23558/0/

Package Explorer:
index.php/fa/23559/0/

The package explorer view seems ok. I normally do not use it, but I don't see any duplicate entries in the above screenshot.

Here are the .project and .classpath files:

.project:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>msw-lib-asi</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
</projectDescription>


.classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
        <classpathentry kind="src" output="target/classes" path="src/main/java">
                <attributes>
                        <attribute name="optional" value="true"/>
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
        <classpathentry kind="src" output="target/test-classes" path="src/test/java">
                <attributes>
                        <attribute name="optional" value="true"/>
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
                <attributes>
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
                <attributes>
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
        <classpathentry kind="output" path="target/classes"/>
</classpath>


Please note that the problem also occurrs when I create the project without calling mvn eclipse:eclipse!
Here are the steps to reproduce it:


  1. Create Maven project (see below). Do nothing more!
  2. In Eclipse: File -> Import -> Existing Maven Projects


Here is how I create the Maven project:
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO] 
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
Define value for property 'groupId': : msw.lib.asi
Define value for property 'artifactId': : msw-lib-asi
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  msw.lib.asi: : 
Confirm properties configuration:
groupId: msw.lib.asi
artifactId: msw-lib-asi
version: 1.0-SNAPSHOT
package: msw.lib.asi
 Y: : 
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: msw.lib.asi
[INFO] Parameter: packageName, Value: msw.lib.asi
[INFO] Parameter: package, Value: msw.lib.asi
[INFO] Parameter: artifactId, Value: msw-lib-asi
[INFO] Parameter: basedir, Value: /home/wagner/dvl/prj
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: /home/wagner/dvl/prj/msw-lib-asi
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.299 s
[INFO] Finished at: 2015-10-16T05:44:39+02:00
[INFO] Final Memory: 14M/241M
[INFO] ------------------------------------------------------------------------


As a result, the problem occurrs with and without calling mvn eclipse:eclipse. So I don't know if it's useful.

But since I do not do anything except project creation and eclipse import, I don't know what I am doing wrong.
I believe this behavior must be the same for you all...

What can I do?

Thank you
Magnus
  • Attachment: eclipse.png
    (Size: 29.44KB, Downloaded 2262 times)
  • Attachment: eclipse-2.png
    (Size: 16.93KB, Downloaded 2297 times)
Re: Mars shows source folder multiple times [message #1712422 is a reply to message #1711433] Sat, 24 October 2015 03:01 Go to previous messageGo to next message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
Are there ideas how to finally deal with this? Do I have to live with this issue?
I am hesitating beginning my new project...
Re: Mars shows source folder multiple times [message #1712443 is a reply to message #1712422] Sun, 25 October 2015 00:08 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Looks very much like https://bugs.eclipse.org/418344

Until that bug is fixed you may want to stick to the PackageExplorer ...
Re: Mars shows source folder multiple times [message #1715032 is a reply to message #1712443] Wed, 18 November 2015 16:17 Go to previous message
Magnus Warker is currently offline Magnus WarkerFriend
Messages: 16
Registered: October 2012
Junior Member
Hello and thank for the note!

I thought my project were corrupt, but as you pointed out, it seems to be a bug in eclipse. So I can go on with the project and someday the bug will be fixed...

However, I still would like to know if I need mvn eclipse:eclipse?
As I have seen, you can import a maven project in eclipse with or without having called mvn eclipse:eclipse before.
So what's better?

Thanks
Magnus
Previous Topic:Configure Installed JREs in a Custom Product
Next Topic:Listening to an ITypeHierarchy of an IType that is being edited
Goto Forum:
  


Current Time: Thu Sep 19 06:01:30 GMT 2024

Powered by FUDForum. Page generated in 0.05075 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top