provided scope jar files getting deployed

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of support-joy support-joy 5 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #324485 Reply
    Profile photo of ltrares
    ltrares
    Member

    I have run into problems with the following jars getting deployed in my Maven J2EE project:
    1) jsp-api
    2) servlet-api

    I’ve noticed that even though I mark these artifacts as “provided” scope in my POM, they show up in my installed “lib” directory and conflict with files provided by my servlet container (MyEclipse tomcat) as well as other JSP tag libraries I’m using (apache tiles and jstl). I have verified in the Maven dependency hierarchy that all references to these jars have provided scope.

    {Note: when I’m not using jstl and apache tiles, I get a warning about jar validation on server startup but everything works fine. when I try to use those tag libraries, I get exceptions when running only those JSP pages.}

    This keeps happening periodically and I fix it by doing the following:
    1) Go to project settings/build path and remove ALL the referenced libraries
    2) run mvn clean
    3) run mvn eclipse:eclipse
    4) refresh the project (F5)
    5) run mvn install

    Now the offending jars are not in my deployed lib directory.

    {I don’t know if it is relevant but I’m running my web app against the target directory so I need to use mvn install to refresh those files.}

    So my questions are:
    1) What is causing these jars to show up in my deployment?
    2) How do I stop these jars from getting deployed again?

    here’s my system information:
    *** Date:
    Wednesday, March 21, 2012 9:55:23 AM CDT

    ** System properties:
    OS=WindowsXP
    OS version=5.1.0
    Java version=1.6.0_13

    *** MyEclipse details:
    MyEclipse Blue Edition
    Version: 10.1 Blue
    Build id: 10.1-Blue-20120224 build12 06-Mar-12 09:23

    *** Eclipse details:
    MyEclipse Blue Edition

    Version: 10.1 Blue
    Build id: 10.1-Blue-20120224 build12 06-Mar-12 09:23

    Eclipse Platform

    Version: 3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q
    Build id: M20120208-0800

    Eclipse Java Development Tools

    Version: 3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1
    Build id: M20120208-0800

    Eclipse Plug-in Development Environment

    Version: 3.7.2.v20120120-1420-7b7rFUOFEx2Xnqafnpz0E–0
    Build id: M20120208-0800

    Eclipse RCP

    Version: 3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272
    Build id: M20120208-0800

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\MyEclipse Blue Edition\MyEclipse Blue Edition 10\myeclipse-blue.exe
    -name
    Myeclipse-blue
    –launcher.library
    C:\Program Files\MyEclipse Blue Edition\MyEclipse Blue Edition 10\Common/plugins/org.eclipse.equinox.launcher.i18n.win32.win32.x86_4.2.0.v201201111650\eclipse_4201.dll
    -startup
    C:\Program Files\MyEclipse Blue Edition\MyEclipse Blue Edition 10\Common/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    -install
    C:\Program Files\MyEclipse Blue Edition\MyEclipse Blue Edition 10
    -configuration
    C:\Program Files\MyEclipse Blue Edition\MyEclipse Blue Edition 10\configuration
    -vm
    C:\Program Files\MyEclipse Blue Edition\MyEclipse Blue Edition 10\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\bin\client\jvm.dll

    Thanks,
    Luke

    #324494 Reply
    Profile photo of ltrares
    ltrares
    Member

    Solved this problem after way too much tail chasing.

    Maven scope was working correctly:
    Provided scope jars (servlet-api, el-api, jstl-api) were correctly in the build path but were correctly not being copied into target lib directory.
    However, when I deployed the web app, they would mysteriously appear.

    The mystery is in the default myeclipse deployment properties:
    Project -> properties / my eclipse / web / deployment / library deployment policies

    Make sure that “JARs from the build path” is unchecked. That was essentially overriding the POM provided scope. The provided JARs are supposed to be in the build path so you can build against them.

    Maybe the default behavior could change or a warning could be provided for Maven apps that use the provided scope?

    Luke

    #324768 Reply
    Profile photo of support-joy
    support-joy
    Member

    Luke,

    Good to hear you are all set. Yes the library deployment policies are default set here – Window > Preferences > MyEclipse > Java Enterprise Project > Web Project > Deployment tab > Library Deployment Policies or project specific is listed under Project > properties > my eclipse > web > deployment > library deployment policies

    I shall escalate your suggestion to dev team members.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: provided scope jar files getting deployed

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