Reputation: 59
Iin Eclipse it's possible to change the order via project settings (Context menu
-> Project settings
). Tab Build Path
, there you can move folders up/down. Following this steps changes the order of source folders.
But after a mvn eclipse:clean
-> mvn eclipse:eclipse
, the changes get lost. Is there a solution to do that permanently?
I have also done my changes in my POM without success:
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
Many thanks for your help.
Upvotes: 2
Views: 212
Reputation: 1204
There is an M2Eclipse - Eclipse Maven Integration. Use it to utilize powers of both Maven and Eclipse.
Maven can automatically manage your projects dependencies. For example Gson library can be added to your project by inserting this to pom.xml
:
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
if you have M2Eclipse in installed in your eclipse. New item Maven Dependencies will appear in Package Explorer under your project. And Gson library will be added to your classpaths.
You do not need to change dependencies order. They will be resolved by maven automatically.
Dependency management is one of Maven's main features. Use it.
Upvotes: 1