Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven package structure changed after build Eclipse

I created a Maven project in Eclipse. Initially my package structure was like

-src/main/java
---com.package1
---com.package2
-src/main/resources

When I build the project successfully and got war deployed in tomcat, My project structure changed to

-src.main.java.com.package1
-src.main.java.com.package2
-src.main.resources

This is generating errors in Java class files in packages import declarations. I want to restore my original project structure. I have m2eclipse plugin installed in Eclipse.

I also tried Maven>Update Project.. (I read somewhere on Stack Overflow that it will restore the original structure) but it is generating the following error

Failed while installing JAX-RS (REST Web Services) 1.1.
org.osgi.service.prefs.BackingStoreException: Resource /Workspace/ProjectName/.settings'      does not exist.

Please help how I can restore my project structure back.

like image 676
isahilarora Avatar asked Aug 26 '14 15:08

isahilarora


1 Answers

The following helped in my context:

  • Eclipse Luna (4.4.2) with Maven embedded
  • Multi module project where folder structure is
    • parent P
      • module A
      • module B
  • P is a normal Eclipse project while A and B are Maven projects
  • P is a closed, A and B are opened
  • the error happened in B with message Resource /P/B/.settings not available

After opening P again the error disappears and Project>Maven>Update Project... works fine.

like image 140
Claude Avatar answered Sep 21 '22 15:09

Claude