• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

maven

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I don't know if this is the correct forum, I tried to find somethig about maven but I didn't find anything.

I am new working with maven, I am trying to create an old web application as a maven project, I don't know how to create the directory structure for that. I used the archetype maven-archetype-webapp, but now I don't know where to put my jsps and everything. I have a classes folder in my WEB-INF folder, but I don't know if I have to take it off, because maven has a directory called target where it puts all complied classes.

I don't kno If somebody can help me with this.

Thank you in advance

Elsy
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to a more appropriate forum.
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Elsy,

was it really so hard to find information? I've often heard or read that Maven documentation was really poor in the past but by now there's quite a lot of information on the Maven homepage itself and there are tons of other articles etc.

But for your specific problem have a lookt at Maven standard directory layout.

Here you can see the directory layout it expects for any project. You can still customize it but you save time and trouble just by following the Maven conventions. For web applications all the "web" specific part go to the "src/main/webapp" directory, that is HTMLs, JSPs and WEB-INF for example. I hope this helps solving your problem

For general information and examples about Maven Sonatype is a very good source of information. As I said the Maven homepage and various other pages are really valuable, too.

Marco
 
Elsy Mena
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Marco, I did found the first link you told me, but I wanted more information. The second one its very good also.

Thank you again for your help and for your kindness, have a great day
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome ;-) If you have more questions just let us know...

If you take some time to learn you will surely see the full advantages of Maven based projects. Once you know how everything works and if you agree to the conventions (like the directory structure) it's really, really easy to use. And it simply works! Use it from the command line, any of the popular IDEs or other tools like continuous integration servers and it just works without any manual configuration.

Plus there are lots of helpful plugins for additional tasks. For example you could use a plugin which can automatically deploy your web application in case of a successful build and test run etc.

Marco
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should also read the free "Maven the Definitive Guide", it pretty much guides you through everything you need to know.
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd say that's basically the link from Sonatype I posted above

Marco
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We definitely do encourage people to RTFM, although it's a point of pride that we don't flame people into it here at the JavaRanch like some forums do.

Still, here's a freebie, since it will save you a lot of pain:

Don't put files in the target directory!

The entire target directory and its children are subject to being deleted by maven. In fact, "mvn clean" will do exactly that. So anything you want not to get deleted shouldn't go there. In fact, you really shouldn't put anything there. It belongs to maven, and if maven wants something there, it will put it there.

Because Maven deletes target and its children, when using a source code control system such as Subversion or CVS, you should put the target directory into the project vcs "ignore" list.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic