facebook

web projects including jars from other projects? [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #203069 Reply

    mrzeld
    Member

    ok. i have two web projects currenlty. i am wanting to create some objects that will be used by both of these projects. so i created a third project (plain java project). this third project will create a jar file that needs to be placed into the WEB-INF/lib directories of the two original web projects. how do i get this jar there using ME?

    the web projects compile fine in eclipse (i set those projects to depend on the third project). but nothing is being put into the WEB-INF/lib or WEB-INF/classes directory on the web server for either web project. so the web apps don’t work when you access them on the web server.

    thanks!

    #203073 Reply

    Bill Winspur
    Member

    Right click on the WEB-INF/lib/ directory in the navigator pane and pick the import menu item.
    Pick the filesystem source in the resulting import wizard and click next
    Click the browse button
    Use the import directory dialog to navigate to the directory that has your jar file and click OK
    In the right hand pane, of the wizard check the box next to your jar file and clik finish.

    Your jar should be transferred to WEB-INF/lib/

    #203082 Reply

    mrzeld
    Member

    thanks for the suggestion, but it doesn’t solve the problem. doing the import, copies the jar file to the WEB-INF/lib directory in eclipse. and that is it. if i make changes to the jar file then i have to re-import into all my webprojects? there has to be a better way to do this. i can’t be the only person that has wanted to do this.

    i could create seperate jar desciptions in the java project and create each into the webapp’s lib directory (inside the tomcat folder) directly , but that isn’t pretty. or is it?

    #203455 Reply

    wattyp
    Member

    I have the same question…

    Is there a way to auto build and link dependent utility jars in web projects, or is the tool deficient in this respect?

    [yes] then this needs to be added to the feature list IMHO PDQ!

    plus is there any type of workaround

    [no] show us how to do it

    regards,

    Paul.

    #203456 Reply

    wattyp
    Member

    mmm, got my no’s and yes’s the wrong way around 🙂

    #203458 Reply

    wattyp
    Member

    sorry, ignore, just read another post indicating it will be an enhancement in 2.7

    #203459 Reply

    mrzeld
    Member

    wattyp,
    can you post the link to the other post?

    #203461 Reply

    wattyp
    Member

    https://www.genuitec.com/forums/topic/library-files-in-a-web-project-enhancement/

    although, it doesn’t solve anything at the moment…

    AFAIS there is also no way to create an utility project that creates an .jar archive as part of the build process automagically, or have I missed something? (apart from using the one shot export menu).

    The list of tasks for each new build of an web project utility jar I see as:

    1. (re)build utility project

    2. manually export a jar to /WEB-INF/lib of all dependent projects

    3. once only: add to build path within each of dependent projects this new jar

    4. deploy web projects

    Do you agree?

    Paul.

    #203462 Reply

    mrzeld
    Member

    i believe the “hard-to-swallow” solution to this is to edit the build.xml file yourself and make it happen. but for those of us less gifted in the art of ANT, it would be nice for such functionality to be included by ME in some way.

    i have enough to learn right now, ANT isn’t up there on the list yet.

    thanks

    #203554 Reply

    Scott Anderson
    Participant

    We’ll be adding support for dependent utility projects as part of 2.8. That will allow you to specify projects that should be packaged as jars when your application is deployed. I think this is what you’re after.

    #203598 Reply

    💡 One work-around (prior to ME 2.8 ) is to add the jars/class directories to the application server paths ( preferences>My Eclipse>Application Servers><<server>>paths ) . It is not pretty, but it may do the trick for you.

    #203606 Reply

    Riyad Kalla
    Member

    GSX thanks for the followup, I’m sure other users will find it helpful.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: web projects including jars from other projects? [Closed]

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