views:

56

answers:

4

ant "war" task does just that - creates WEB-INF along with META-INF, depending on task attributes.

what is considered a best practice? keeping all my libs elsewhere for re-use, like log4j and then build them with "war" task or have everything (including jars) checked-in under WEB-INF? I have multiple apps that could re-use same libs, images, htmls, etc. Our developers use RAD7/Eclipse.

I'd appreciate any examples with opensource Java Web Apps repo layouts.

thanks!

+2  A: 

If you can reliably, dynamically create it, the don't check it in. That's going to cause confusion. In this situation it's analogous to checking in .class files.

Rather, check in the build file and the artifacts you use to create it, and let the build take care of it.

Brian Agnew
A: 

We work with Eclipse. I have found that having the files that Eclipse do not hide checked in work well for us. You check out the project, and you are ready to go. No further ant stuff to run or remember to run.

If you build with ant always (e.g. if you come from a Netbeans shop) then check in only those files which are original. All those that are copied from elsewhere, should explicitly be not checked in.

Thorbjørn Ravn Andersen
+2  A: 

I'd appreciate any examples with opensource Java Web Apps repo layouts.

Here's an example of web application which is using a classic Maven directory layout:

hifaces20-demo-messageboard-0.1.0-project.zip

src
  main
    java
    resources
    webapp
      WEB-INF
        web.xml
  test
    java
    resources
pom.xml
lexicore
A: 

I generally do check in the WEB-INF folder but exclude the lib and classes folder. When I need the libs I retrieve them using Maven or Ivy (ant tasks). Seems to work well, I only check in the libs if it's an extreme case where it's likely I wont have an Ivy cache or the lib is 'special' and doesn't exist anywhere else.

oneBelizean