Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

How do you make your source tree Eclipse/JUnit friendly?

I've never had a problem getting builds and unit tests to work with Ant. However, unit tests run faster in an IDE, so I'm trying to refactor some code to allow for testing in the IDE. My current directory structure looks like this:

-- project
   - web
     - WEB-INF
       - classes

I need both "WEB-INF" and "WEB-INF/classes" in my classpath. There's XML files under WEB-INF for Spring and Commons Validator, and there's a log4j.xml under WEB-INF/classes for log4j. These files are all in their natural locations as far as all the projects I've seen. However, Eclipse won't allow me to nest classpaths - so it's virtually impossible (as far as I know) to add both directories to my classpath. Any ideas how to workaround this Eclipse "feature" are appreciated.

For those "IDEA is better" folks - I agree. IDEA allows me to add web, web/WEB-INF and web/WEB-INF/classes to my classpath with no issues.

Posted in Java at Jun 02 2004, 12:46:10 AM MDT 6 Comments
Comments:

Hi, in the source folders of your project : you can add "WEB-INF" and exclude the "classes/" folder. Another way to do it is to edit the class-path of your run configuration, with Advanced -> Add External Folder you can add nested folders to the classpath ...

Posted by Thomas WOLF on June 02, 2004 at 07:40 AM MDT #

IDEA is better ;-)

Posted by Stephan Schmidt on June 02, 2004 at 10:38 AM MDT #

In Eclipse 3.0 M9, I searched for "exclusion filters". I found a document titled, "Creating a new source folder with exclusion filter". Here's a few excerpts:

In a project that uses source folders, you can create a new folder to contain Java source code with exclusion patterns. Exclusion patterns are useful if you have nested source folders.

[snip]

From an existing Java Project

  1. Before you start, make sure that your project properties are enabled to handle exclusion filters in source folders.
  2. In the Package Explorer, select the project where you want the new source folder to reside.
  3. From the project's pop-up menu, select New > Source Folder. The New Source Folder wizard opens.
  4. In the Project Name field, the name of the selected project appears. If you need to edit this field, you can either type a path or click Browse to choose a project that uses source folders.
  5. In the Folder Name field, type a name for the new source folder. If you choose a path that is nested inside an existing source folder, you will see an error saying that you have nested source folders.
  6. Check Update exclusion filters in other source folders to solve nesting.
  7. Click Finish when you are done.

I'm not sure if that will solve everything you need, but hopefully it helps you have nested classpaths using your source folders.

Posted by Tim on June 02, 2004 at 03:49 PM MDT #

Thomas - both of your suggestions worked - thanks! I decided to go with the 2nd one since the 1st required setting the run-time classpath for each unit test. I ended up adding web/WEB-INF/classes as a "class folder" and then adding "web" as a source folder, excluding WEB-INF/classes. I only have files in WEB-INF and WEB-INF/classes, however, many of the classpath's in my Spring config files have /WEB-INF/file.xml so they'll work when running in a servlet context. Pointing my classpath to "web" picks up these files from web/WEB-INF/...

Thanks again - you da man! ;-)

Posted by Matt Raible on June 02, 2004 at 04:11 PM MDT #

Matt are you using a plugin for webdev like myeclipse or something similar. I just evaluated eclipse with myeclipse and struts studio and found them both lacking.

Posted by Steven Citron-Pousty on June 02, 2004 at 09:22 PM MDT #

Steven - nope, I'm not using any robust plugins like MyEclipse. I bought a copy, I've just never used it. I'm an HTML developer from waaayyy back, so I've gotten very used to text editors and doing things from the command line. Eclipse and IDEA are just fancy text editors to me. If I had the time, I'd like to learn more about them and rely on them more. For traditional web development (i.e. CSS, JavaScript, JSPs), I tend to use web development tools (i.e. HomeSite, TopStyle, BBEdit) rather than an IDE.

Posted by Matt Raible on June 02, 2004 at 10:08 PM MDT #

Post a Comment:
Comments are closed for this entry.