File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Still do not understand Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Still do not understand Maven" Watch "Still do not understand Maven" New topic
Author

Still do not understand Maven

M Marin
Ranch Hand

Joined: Feb 20, 2010
Posts: 32
Hello,

I am trying to make sense out of Maven. At the moment I am trying to integrate JSF, Spring and hibernate and I want to know how Maven can help me.
I have a working small test web-app, which already integrates the three frameworks. I downloaded this app from the internet and I managed to import it into eclipse using a maven import project utility. Can I use maven, somehow, in order to start developing a more real app from this test app, taking the integration of the framework components?
My problem is building a web application with the above frameworks, but the integration of them is really hurting me. Can Maven save this pain?

Thank you.David
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

but the integration of them is really hurting me. Can Maven save this pain?

What kind of integration are looking for? Maven helps you manage the dependencies and build the application artifacts (and many more...). You may read more in the Maven cookbook.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Maven was designed, in fact, precisely to save you this kind of pain.

You can use the special Maven goal "eclipse:eclipse" to have Maven construct the necessary files to make a Maven project eclipse-friendly. There's also an IntelliJ goal for that IDE.

I have some very complex projects. They're built on Spring, Hibernate, JBoss RichFaces, and often include additional subsystems like javamail and Quartz Scheduler. It can occasionally be frustrating, because once you get that much stuff in one app, they can start fighting over conflicts on shared resource versions. But one of the strengths of Maven is that once you find a "magic combination", Maven will lock the project to the specified versions and not break as soon as one of the contributing components gets updated.

Of course, finding the magic combinations is the real challenge. Usually I end up reading other people's blogs. Shared suffering.

One thing that can really help you get started is archetypes. There are quite a few published archetypes for different types of Maven projects. Plus, it's actually pretty easy to define your own. Although a lot of my webapps have been simply cloned from earlier maven projects, occasionally, I'll use an archetype to start a project from scratch.


Customer surveys are for companies who didn't pay proper attention to begin with.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Maybe I am misunderstanding what you are attempting to accomplish, but it sounds as if you have a project that uses Maven for building, and now you and to extend it or add new functionality. The statement "Can I use maven, somehow, in order to start developing a more real app from this test app" implies that Maven can help you write an app; it can't. What Maven can do is manage your dependencies. But the app itself you have to write. What Maven can help you with is adding new JARs to your app when you need to make use of them (for example, you need the commons math library but it isn't included in the build path yet).

What reading have you done on Maven? Is this your first attempt on working with a Maven project?


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Still do not understand Maven
 
Similar Threads
Frameworks
Maven or Ant?
installing maven 2
maven archetype generate
Package importing problem