Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Netbeans 6.7.1 + sharing code across projects

Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a Netbeans project that contains much shared code and many libraries - database handling stuff, that sort of thing, which is common to all my projects.

In Netbeans 5.0, I created a "shared" library that referenced the build/web/WEB-INF/classes directory of my shared project and the jar files within the lib directory of the shared project. I would add this library to other projects as necessary. On building these other projects, Netbeans copied class files to the build/web/WEB-INF/classes subdirectories of the project being built and the jar files to the build/web/WEB-INF/lib directory. Essentially the code and lib files were integrated into the structure of the new project.

I have tried and failed to replicate this behaviour in Netbeans 6.7.1. I have tried creating a library - if I include the build/web/WEB-INF/classes directory from my shared project, when the new project is built, the build/web/WEB-INF/classes directory is copied to the build/web/WEB-INF/lib directory - not the desired behaviour. I could add lib/build/web/WEB-INF/classes to my classpath but I'm not happy about the idea of class files in my lib directory. I can make it work by adding a project, rather than a library - shared.jar is copied into WEB-INF/lib. I can also get it to work if I create a (local?) library containing shared.jar. However, what I ideally want is the package directory and class files of the shared project integrated into the package directory structure of the new project.

Any suggestions on how to achieve this very gratefully received.


It was the best of times. It was the worst of times. It was a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic