Reputation: 5472
Using Eclipse that was being used prior on the project by another developer. Most things are flagged as red and broken. Seeing files in
src/main/java/...
and the same exact files over in
java resources/src/main/java...
Just confused over what is what, what is temp, what to keep to trash or how to fix the project environment.
Any easy fix to this?
Upvotes: 15
Views: 27974
Reputation: 843
Your question's has multiple answer since they already exists everywhere and easy to get them I am just pointing you to them with links and little description.
What is Maven ?
For more information -> http://maven.apache.org/what-is-maven.html
Why Maven ?
Why resources directory ?
Before maven exists we used to have resources package within application,which will actually contain some application configuration properties file,Internalization property files , XML files (basically non java files which are required for application run-time ).
One case study i were been using Resource directory
In our company we wanted have different property values for development,staging, pre-production,production environment.So we had four directories and Resources folder saying environment name.Each directory will contain its own property files and properties.During maven build we should mention which profile is this build for ?.Based upon that only specific resource files are loaded in the deployment assembly.
More information about profile in maven -> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
Eclipse error's solving
And your eclipse is having red flags you need to fix the build path issues,if it gets the respective source code.Red flags will be vanished.Since you didn't mention what errors you are seeing i am placing general discussion on build path fixing - > Problem with Java Buildpath in Eclipse
Upvotes: 5
Reputation: 160181
There's no standard for anything at the root level called resources
.
src/main/resources
is normally where you put non-Java artifacts that should be moved into the normal package hierarchy, like XML config files loaded as classpath resources.
It's impossible to help much beyond that, other than to say "check your Maven file to see if anything actually references those files", particularly if anything generates files to there, or moves them there as part of an assembly process, but again, that would be non-standard Maven usage.
Upvotes: 13
Reputation: 1951
Go to your Project folder e.g. MyProject in command Prompt
run below commands one by one (assuming you have installed maven in your system)
cd C:\MyWorkSpace
cd MyProject
mvn clean install -DskipTests=true
mvn eclipse:eclipse
and then right click your project and click Refresh
That might solve your problem.
Upvotes: 2