Adam Hughes
Adam Hughes

Reputation: 16309

Netbeans: change package location without moving files

I have a netbeans project with directories like:

Top
  - pom.xml
  - src
     |
      - main
         | 
          - java 
              |
               - com
                   | 
                     - foo
                         |
                           - bar 
                                A.java
                                B.java

The package designation for A.java then is:

 package main.com.foo.bar

Where netbeans is using the toplevel directory as the source, and reading the pom.xml file to bring in maven dependencies.

My colleagues are developing in Eclipse, and their package headers are

package com.foo.bar

Is it possible to somehow specify to netbeans that the com folder should be recognized as the top-level directory for the source files, but retain the location of pom.xml? They were able to implement such packaging in Eclipse by specifying the source directory as com, somehow.

Upvotes: 0

Views: 847

Answers (1)

javapapo
javapapo

Reputation: 1342

Maven is about, defaults and some established conventions. The structure is .

src / main / java / com / foo / bar

You are missing the java sub-folder. If you add it then automatically all the IDE's that properly support and use Maven will import your code properly.

Please have a look if you have some spare time to the standard maven layout

Hope that helps

Upvotes: 2

Related Questions