views:

1335

answers:

2

Hi

i'm using maven 2.1-SNAPSHOT as eclipse plugin. My project structure is like this:

src/main/java
   -model
   -service
   -action
src/test/java
   empty atm
src/main/resources
   empty atm
src/test/resources
   empty atm
src/main/webapp
   -js
    -dojo
   -META-INF
   -WEB-INF
     web.xml
     appcontext.xml
     struts.xml
   index.jsp

I'm having trouble understanding the build process and where to put which file. I use as Application Server Jetty but i want to deploy my project on tomcat as well (so i have set up in my pom packaging war).

When i run my project with the maven:install command my target folder looks like this: myproject.war
war
   not relevant
test-classes
   empty atm
myproject
   js
   META-INF
   WEB-INF
   index.jsp
classes
   model
   service
   action

My problem is that i need in the classes folder my persistence.xml which i have in META-INF. And struts.xml too i guess. I'm not sure about dojo either if it is right there. And honestly i don't know if this structure is right at all. I also dont know how to configure that the output changes.

I hope somebody can help me i really want to understand this process how it should be right, maybe there are even nice ressources to lookup to get better at these things. Thanks in advance kukudas

+2  A: 

I believe files that you want deployed to the classpath go in the resources/ folder.

Take a look at the Maven in 5 Minutes guide, along with the Getting Started guide.

matt b
A: 

I think you are missing the resources directory under the src/main/webapp directory. Thats where you can put in your properties and config files for hibernate, struts and spring.

That will allow Maven to copy the files over the the classes directory in the WAR.

Hope this helps.

Deep Kapadia