- This topic has 13 replies, 6 voices, and was last updated 21 years ago by
andyrut.
-
AuthorPosts
-
emmanuelMemberWhen a project makes use of ‘external jars’, I currently copy those manually into the project WEB-INF/lib folder.
I’d like to avoid this manual process and besides the jars could get out of date.
I used the ‘Tomact 4->Paths’ tab and attempted with each of the three options but Tomcat still does not see the ‘external jars’ I require for the project.
Is this a bug? Is the Paths option intended for ‘external jars’?
Could someone assist me please?
Kind regards
Emmanuel
Riyad KallaMemberEmmanuel,
From what I understand of MyEclipse’s functionality (and most Tomcat/Webapp plugins in general) if you app relies on external Jars (somewhere else on your filesystem, in random places) and you want to always make sure they are copied (the most updated version) into your WEB-INF/lib dir before you deploy to Tomcat, I believe you will need to use an Ant script for this. MyEclipse seems to have all the fucntionality to handle a webapp once it is setup, but I do not believe it provides features to help you build out your libraries within a webapp. In my experience this is a pretty manual 1-time process. Unless of course you are working on multiple libarries at the same time that are PART of the main webapp, in which case I would update the ant target for those other projects to also build a jar and put it into your main web-apps WEB-INF/lib dir.Scott please correct me if I’m wrong. Sorry I couldn’t be more helpful.
Scott AndersonParticipantScott please correct me if I’m wrong.
Nothing to correct. Everything you said is true. One thing I’ll add is that there is an inherent difference between placing jars in WEB-INF/lib and adding them to the Tomcat > Paths. Adding to WEB-INF/lib puts the jars on your web apps classpath. Adding jars to Tomcat > Paths places the jars on *Tomcat’s* classpath, not the classpath of your webapp. Hope that clears up the confusion.
–Scott
MyEclipse Support
emmanuelMemberThank you for the assistance.
Adding jars to Tomcat > Paths places the jars on *Tomcat’s* classpath, not the classpath of your webapp.
Scott what I’m still unclear of is, when using the ‘Tomcat > Paths’ option and the jars are added on *Tomcat’s* classpath, would they be seen by my project?
Kind regards
Emmanuel
Scott AndersonParticipantScott what I’m still unclear of is, when using the ‘Tomcat > Paths’ option and the jars are added on *Tomcat’s* classpath, would they be seen by my project?
According to the spec, that behavior is container specific. By default, I believe it is turned off for Tomcat. However, these links tell all about it and have instructions on how to configure the container classpath to pass through libraries to webapps. Be forwarned though that using this mechanism will cut your portability to other containers.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/deployment.html
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html–Scott
MyEclipse Support
Dan HowardMemberThis is not what I’m seeing. I added my JAR (created in another Eclipe project) and when I redeploy the JAR is *deleted*. I then – after deploying – have to copy the file in there.
This JAR is part of my project. Why doesn’t MyEclipse know about this to simply copy the file into the lib folder for me?
Is this a wish list request? 🙂
Scott AndersonParticipantIs this a wish list request? 🙂
In fact it is. There’s an open enhancement request for dependent project support that we should be addressing soon. Until then, you’ll need to copy your lib into your WEB-INF/lib folder either manually or via an Ant task. Once that’s done, the MyEclipse deployer should handle it correctly.
–Scott
MyEclipse Support
emmanuelMemberHello Scott,
Thank you for the assistance.
Kind regards
Emmanuel
Scott AndersonParticipantI decided to mark this topic as Sticky, just so it hangs around as a constant reminder until we get this implemented.
–Scott
MyEclipse Support
Riyad KallaMemberEmmanuel,
2.7 GA includes support for the deployer to follow linked resources in Eclipse, so now what you could do (from your original post) is setup your JARs as links to the actual files elsewhere, but when you deploy, the deployment tool will deploy the targetted JARs… does this functionality meet your needs? (I’m curious if its OK to close this thread).
emmanuelMemberHello Riyad,
I was keenly waiting for this feature, thank you. 🙂
I’m just in the middle of another task. I’ll get to this soon and inform you.
Kind regards
Emmanuel
andyrutMemberThis seemed like the appropriate place to ask this.
I’m using ME 2.7.0. I want to link to an external JAR and have it placed in my project’s Web Root\WEB-INF\lib directory upon deployment. When I add a file to that “lib” directory, select the advanced options, click the “Link to file in the file system” checkbox, and Browse to the path of the JAR file, I get an error message that reads:
“Linked resources must have a project as their parent.”
So naturally, it works when the link is directly under the project, but then it won’t end up in the WEB-INF/lib directory.
From rkalia’s last post, it would seem that what I’m trying to accomplish is now somehow possible in 2.7, but I’ve yet to find out how.
Riyad KallaMemberandyrut,
My post was uninformed. The problem you are experiencing is the only facility provided by Eclipse currently and its quite limited as I have found out. Michael had spoke with the Eclipse team about enhancing the linking support, but aparently its extremely complex as it stands now, and there will be no effort to enhance it further (atleast what I heard currently).I’m sorry I don’t have a better answer for you.
andyrutMember@support-rkalla wrote:
I’m sorry I don’t have a better answer for you.
Not a problem, I believe the dependent-project deployment planned for ME v2.8 may do the trick. 🙂
-
AuthorPosts