facebook

Duplicate jar files in WEB-INF/lib

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #294379 Reply

    dtoubelis
    Member

    I have a MyEclipse Web Project with Maven enabled. The project relies on 4 other projects as dependencies. When compiling classes in MyEclipse gui everything works fine, Maven4MyEclipse properly resolves conflicts and “Maven Dependencies” library shows all the correct versions of jar files. However, when I deploy the project to Tomcat I see all conflicting versions of jar files in WEB-INF/lib and web application obviously fails to start. Here is an example:

    antlr-2.7.6.jar
    aopalliance-1.0.jar
    asm-1.5.3.jar
    asm-attrs-1.5.3.jar
    avalon-framework-4.1.3.jar
    cglib-2.1_3.jar
    commons-beanutils-1.8.0.jar
    commons-codec-1.3.jar
    commons-collections-2.1.1.jar
    commons-collections-3.2.jar

    commons-logging-1.1.1.jar
    commons-logging-1.1.jar

    dom4j-1.6.1.jar
    ehcache-1.2.3.jar
    ejb3-persistence-1.0.2.GA.jar
    hibernate-3.2.6.ga.jar
    hibernate-annotations-3.4.0.GA.jar
    hibernate-commons-annotations-3.1.0.GA.jar
    hibernate-core-3.3.0.SP1.jar
    hibernate-ehcache-3.3.1.GA.jar
    jstl-1.1.2.jar
    jta-1.0.1B.jar
    log4j-1.2.14.jar
    logkit-1.0.1.jar
    slf4j-api-1.5.6.jar
    slf4j-log4j12-1.5.6.jar
    spring-aop-2.5.6.jar
    spring-beans-2.0.8.jar
    spring-beans-2.5.6.jar
    spring-context-2.0.8.jar
    spring-context-2.5.6.jar

    spring-context-support-2.5.6.jar
    spring-core-2.0.8.jar
    spring-core-2.5.6.jar

    spring-dao-2.0.8.jar
    spring-hibernate3-2.0.8.jar
    spring-jdbc-2.0.8.jar
    spring-security-core-2.0.4.jar
    spring-security-core-tiger-2.0.4.jar
    spring-support-2.0.8.jar
    spring-web-2.5.6.jar
    spring-webmvc-2.5.6.jar
    standard-1.1.2.jar

    Any ideas why?

    #294415 Reply

    Loyal Water
    Member

    dtoubelis,
    Im not sure what is the cause of this issue. I’ll ask the dev team to investigate this issue.

    #294480 Reply

    allenparslow
    Member

    The “Maven Dependencies” library not having the duplicates mean that your pom is ok (i.e. you don’t have two of the same jars with slightly different groupid for example).

    Check your lib folder in src/main/webapp/WEB-INF/lib or if you used the wizard instead of the maven standard then project/WebRoot/WEB-INF/lib: both of them should be empty.

    Also, try clean from the project menu (followed undeploying your webapp, and redeploying it).

    I recommend the following in web project poms (not MyEclipse specific) (when you run the mvn clean command from the command line or maven clean command from the project right-click (run as) menu it cleans the output directory):

    <build>
            <plugins>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>
                                    src/main/webapp/WEB-INF/
                                </directory>
                                <includes>
                                    <include>lib/</include>
                                    <include>classes</include>
                                </includes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
            </plugins>
        </build>

    NOTE: the directory specified must be changed if using project/WebRoot/WEB-INF/lib.

    #294481 Reply

    allenparslow
    Member

    Note: after running the above specified mvn clean, you will need to do build from the project menu.

    #294504 Reply

    Loyal Water
    Member

    dtoubelis,
    Can you pm me an example project that will help me reproduce this issue at my end. You can hit the pm button below my post and send me the project.

    #294555 Reply

    dtoubelis
    Member

    Thanks for the help Nipun. Apparently it was an issues with maven itself. Maven4MyEclipse plugin was resolving dependensies fine but maven beneath had a problem. I traced this issue using maven directly, fixed couple of depencencies and it is all okay now. Thanks again. BTW your plugin configuration is quite usefull.

    #294598 Reply

    Loyal Water
    Member

    Your welcome.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Duplicate jar files in WEB-INF/lib

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in