Query on Maven dependencies?

83 views
Skip to first unread message

Vicky

unread,
Aug 3, 2013, 4:03:34 PM8/3/13
to java-bra...@googlegroups.com
First of all, thanks for this wonderful MAVEN tutorial. Earlier I was not comfortable with it but now I am. But still I have queryies on 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.

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 for this project. 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.

Vicky

unread,
Aug 19, 2013, 9:04:45 PM8/19/13
to java-bra...@googlegroups.com
Nobody :(

tarencer

unread,
Sep 10, 2013, 10:09:07 AM9/10/13
to java-bra...@googlegroups.com
Hi Vicky,
 
I am not an expert on Maven but I'll try to answer your questions as per my experience thou I have not worked on Spring MVC.
 
1) To create a project, I usually create a dynamic web project using eclipse and then I enable maven dependency for the created project. Then in the pom, I just provide the dependencies required to run the project. In your case, Spring MVC libraries.
 
2) Maven always considers the latest version.
    For eg :
 
    if your dependencies are :
 
    +  log4j 1.16              (specified by you in pom)
    -   spring-core 3.0.0    (specified by you in pom)
        +    log4j 1.15        (transitive dependency)
 
    In this case log4j 1.15 will be ignored and log4j1.16 will be used.
    If you hadnt mentioned log4j dependency in pom, maven would go for log4j 1.15.
   
    You can use "mvn dependency:tree" command to check all the dependencies of your project.
 
 
Thanks,
Tarsicius Rodrigues
 
   

On Sunday, August 4, 2013 1:33:34 AM UTC+5:30, Vicky wrote:
Reply all
Reply to author
Forward
0 new messages