Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change order of source folders in Eclipse / SpringSource Tool Suite

Tags:

eclipse

maven

I am working on a Java Maven project using the SpringSource Tool Suite. I have the standard Maven directory structure

src
-> main
   -> java
   -> resources
-> test
   -> java
   -> resources

The structure is defined in the .pom file:

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**</include>
            </includes>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>

    <testResources>
        <testResource>
            <directory>src/test/java</directory>
            <includes>
                <include>**</include>
            </includes>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </testResource>
        <testResource>
            <directory>src/test/resources</directory>
        </testResource>
    </testResources>
</build>

STS displays the source folders in the test branch first and then the source folders from the main branch. So I get something like this:

src/test/java
src/test/resources
src/main/java
src/main/resources

However, I would like to have the folders from the main branch first. Any ideas on how to change this?

like image 480
Jack Avatar asked Apr 19 '12 07:04

Jack


1 Answers

In Eclipse it's possible to change the order via project settings.

Right-click on project -> "project settings" -> Tab "Build Path": "Configure Build Path...", tab "Order and Export", use the "Up" and "Down" buttons to move folders up/down.

like image 85
proko Avatar answered Oct 01 '22 22:10

proko