Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So an Eclipse Maven project has to obey both conventions. The src/main/java and src/main/resources subdirectories will be configured as Build Path Source directories (and maybe also the test directories). The default output directory will be target/classes. This happens automatically when a Maven project is digested and turned into an Eclipse project by the Eclipse Maven plugin.

...

Java Source Files Appear

...

Twice in the Project

When you designate a particular directory to be an Eclipse Build Path directory is configured as a Java Source directory, then the Java source files under it is in the first group of directories listed for that project in the Project Explorer viewappear twice in Project Explorer. Under the "src" subdirectory they appear as ordinary files, just as if they were text or html. This is generally not the useful version of the file and should be ignored. The better file listing occurs first in a special view of configured Source directories. Here information is displayed in Java language terms. So the Package name org.jasig.cas.adapters.jdbc is displayed in dotted notation as you would find in a Java package statement, instead of displaying each element of the path as a directory as in "org/jasig/cas/adapters/jdbc". It is in the Source directory display that Eclipse knows this is a Java program and has access to the specific Java language tools for editing and debugging.

In this example:

  1. the top line is the cas-server-support-jdbc Project
  2. it is followed by the src/main/java source directory
  3. that contains the org.jasig.cas.adaptors.jdbc Java package
  4. which in turn contains four Java source files

...

What is the difference between the two? When the Java files are first listed, they are preceded by the little triangle icon that means they can be opened further as a tree. If you open one, you find a class and if you open the class you find fields:


Whereas, down in the file display the same Java source file name has no tree icon. Viewed as a file instead of Java source, the source file is the bottom of the hierarchy and has no contents.

...