MyEclipse Forums
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ltrares
Post subject: provided scope jar files getting deployed  PostPosted: Mar 21, 2012 - 04:07 PM



Joined: Mar 21, 2012
Posts: 2

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
 
 View user's profile Send private message  
Reply with quote Back to top
ltrares
Post subject: solved  PostPosted: Mar 21, 2012 - 07:31 PM



Joined: Mar 21, 2012
Posts: 2

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
 
 View user's profile Send private message  
Reply with quote Back to top
support-joy
Post subject:   PostPosted: Mar 29, 2012 - 08:22 AM
Registered Member
Registered Member


Joined: Feb 03, 2009
Posts: 3442

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.

_________________
Joy
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits