This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Query on Maven dependencies? 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 "Query on Maven dependencies?" Watch "Query on Maven dependencies?" New topic
Author

Query on Maven dependencies?

shai ban
Ranch Hand

Joined: Jan 05, 2010
Posts: 177
Hi All,
I have some queries on maven dependency.
Lets say, I want to create a Spring MVC project. Now the 1st query, how to find the spring mvc specific archetype OR I should I start with dynamic web project archetype. If spring specific archetype is found then what you need to setup in maven?

2nd query, Lets say a project has a lot of dependencies and obviously it will be using different different versions of different libraries including 3rd party jars. So, is there any way to know the particular version of these jars that this project supports eg. I need to include log4j then which version I should go for? How to know that? Because all versions of log4j may not be supported.

Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

"Dynamic web project" is an IDE-specific term, and therefore not directly applicable to Maven, which, when properly configured doesn't need an IDE to function.

You can start a new Maven project by finding a suitable archetype and generating from it, by cloning an existing project (which is basically what an archetype does), or by building up the POM from scratch. Usually, it's easier to plunder an existing project structure than create from scratch, but often you won't have an exact match among the available archetypes and clonable existing projects, so you take a reasonably good fit and customize.

Regarding software versions. Yes, you can essentially end up in something resembling the infamous "DLL Hell" when you construct large projects and have to find versions of stuff that play well together. It's not uncommon, in fact, to have to add even more stuff to the mix, such as the SLF4J modules that all different libraries using different logging packages to unify themselves under one particular logger.

Archetypes can help avoid many of these problems, since the archetypes have (allegedly) been built with workable version relationships already determined. Their downside is that some archetypes may be fairly antiquated and may not be using sufficiently-modern version of what you need.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Query on Maven dependencies?
 
Similar Threads
maven struts2 plugins
Questions about DVCS
Unable to create Spring AOP archetype using Maven in Eclipse
How to include optional jars in Maven while building WAR
setup spring web project?