Results 1 to 3 of 3
  1. #1
    bmelloni is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Question Library JAR projects and including them in other projects

    It is a very common practice to create library projects whose final output is a JAR, and then to include those JARs in other projects (like a Web project).

    In Eclipse I found it easy to create those projects and even setup dependencies so that compilation happens correctly. But I have not found an easy way to:

    (a) Make the library project automatically generate the JAR. I have been able to manually create a JAR by Exporting from a Java project, but it is a hassle when you are in a rapid enhance/rebuild/test cycle.

    (b) Tell a Web project to automatically include the library JAR from the other project into WEB-INF/lib during deployment.

    This was trivial in Netbeans because of its Ant-based build mechanism. I presume that even without switching to Ant builds in Eclipse it is probably still trivial... so, how do you do it?

  2. #2
    vijayabaskar is offline Member
    Join Date
    Apr 2009
    Posts
    37
    Rep Power
    0

    Default

    build.xml file is use to create the jar file and also create folder web-inf and put the compiled files

  3. #3
    bmelloni is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

    Default

    build.xml 'is' the Ant build file. Of course it is the most flexible approach, even though it is not Eclipse's default. My question was about whether there is a 'default' way to accomplish it without having to switch to the optional Ant build mechanism.

    For example, since my post I found a partial solution. If the project that depends on the library projects is a JEE (WAR or EAR) project, setting the 'Java EE Module Dependencies' in the properties will create the JARs from the dependent projects and place them in WEB-INF/lib.

    But I am not sure if that answers the generic question of dependencies between library projects (that should produce JARs) and application projects (that should use them). Perhaps switching the build mechanism to the optional Ant (or Maven) are the only answers within Eclipse.

Similar Threads

  1. Java Projects
    By yiweiang in forum New To Java
    Replies: 2
    Last Post: 12-15-2011, 01:28 AM
  2. projects using jms
    By Parneel in forum Advanced Java
    Replies: 0
    Last Post: 03-31-2009, 07:56 PM
  3. Plug-In Projects
    By ciigma in forum Eclipse
    Replies: 0
    Last Post: 02-16-2009, 06:07 PM
  4. Projects please
    By sudhir in forum Introductions
    Replies: 1
    Last Post: 12-17-2007, 01:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •