Results 1 to 3 of 3

Thread: Maven + Spring + web app Project structure in IDEA

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Default Maven + Spring + web app Project structure in IDEA

    I have done a basic project in Spring. Now I'm trying to step up and work through a tutorial I found that has Spring in a web app. That's fine but unlike the tutorial, we use Maven and we use IDEA 9. So I have tried some experiments to create a project structure with correct content to have an IDEA project that uses Maven to build, is a web app, and uses Spring. Can anyone help me with this?

    I've got the following from asking for a Maven module that supports the webapp and Spring frameworks:
    lib
    src
    main
    resources
    webapp
    web
    WEB-INF
    web.xml
    index.jsp
    pom.xml
    ...
    external libraries

    In a project I created to see what I would get for Spring and Maven, I also got a
    java directory under main
    a test directory under src
    a classpath item
    and a project item
    and there is no pom.

    Both of these are a problem and are missing pieces but I'm not sure what the proper, complete structure should be. This is partly because all the examples I can find use Eclipse. That's fine but we don't and I don't know enough to do the translation.

    Also, is there something like a tutorial online that would cover putting all these pieces together with a line-by-line explanation of the Spring pieces? All the tutorials I've seen simply say things to the effect of "put this code in class abc and then build." Or, is there a book that has a good treatment of putting all these different technologies together "under one tent"? Thanks.
    Last edited by kduncan; Jan 26th, 2011 at 06:48 PM. Reason: Missing a word.

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    my suggestion is to learn to use and use Maven from command line. The IDE plugins for Maven never work 100% well and they hide some of the power of Maven itself. You can create the structure from command line and then import the created structure in a IDEA project.
    That said, I believe there are some good "unofficial" mvn archetypes to build Spring-based webapps. I also, however, suggest you take a look at Spring Roo. I found it an invaluable tool in aiding creation and maintenance of Spring-based webapps.

  3. #3
    Join Date
    Nov 2005
    Posts
    113

    Default

    Actually, when using IDEA 9, when you ask it to create a project, just select "Maven Model" and that should create it (if you want to use an archetype, maven-archetype-quickstart and maven-archetype-webapp are pretty good starting points for JARs and WARs, respectively).

    I haven't seen much in the way of problems with the IDEA maven support - it's solid. That said, you COULD use AppFuse or Roo to kickstart the project, though both have their drawbacks...

    Hope this helps
    - Don

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •