Issue using git checkouts of commons(-math) in Eclipse

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue using git checkouts of commons(-math) in Eclipse

Eric Barnhill
When I check out the commons-math repo from git and import into Eclipse,
the package structure causes errors. Because the dir structure is
src/main/java/org/apache etc., Eclipse throws an error on all import
statements beginning with "org.apache" . It is looking for import
statements that begin with "main.java.org.apache" and offers to switch the
import statements.

This happens whether I import the project as of Git type, or as of Maven
type.

Does anyone know how to fix this?

Thanks,
Eric
Reply | Threaded
Open this post in threaded view
|

[Math] Re: Issue using git checkouts of commons(-math) in Eclipse

Gilles Sadowski
On Wed, 14 Oct 2015 23:13:57 +0100, Eric Barnhill wrote:

> When I check out the commons-math repo from git and import into
> Eclipse,
> the package structure causes errors. Because the dir structure is
> src/main/java/org/apache etc., Eclipse throws an error on all import
> statements beginning with "org.apache" . It is looking for import
> statements that begin with "main.java.org.apache" and offers to
> switch the
> import statements.
>
> This happens whether I import the project as of Git type, or as of
> Maven
> type.
>
> Does anyone know how to fix this?

Perhaps this link will help:
   
http://stackoverflow.com/questions/7628686/eclipse-the-declared-package-does-not-match-the-expected-package

Regards,
Gilles

> Thanks,
> Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Issue using git checkouts of commons(-math) in Eclipse

Luc Maisonobe-2
In reply to this post by Eric Barnhill
Hi Eric,

Le 15/10/2015 00:13, Eric Barnhill a écrit :

> When I check out the commons-math repo from git and import into Eclipse,
> the package structure causes errors. Because the dir structure is
> src/main/java/org/apache etc., Eclipse throws an error on all import
> statements beginning with "org.apache" . It is looking for import
> statements that begin with "main.java.org.apache" and offers to switch the
> import statements.
>
> This happens whether I import the project as of Git type, or as of Maven
> type.
>
> Does anyone know how to fix this?

The packagage layout is a standard maven layout (you can check it
from the command line). Eclipse should knows this layout already, so
it seems strange it doesn't set the paths correctly.

Anyway, you can set the paths manually from eclipse by right-clicking
in the package explorer at project level and select in the context
menu the entry: Build Path -> Configure Build Path.

A popup wizard should appear, where you can select in the right-hand
panel the tab "Source". This tab is used to configure the source folders
to be included in the build path. The list of source folders that are
needed for proper build and test is:

  <project-name>/src/main/java
  <project-name>/src/main/resources
  <project-name>/src/test/java
  <project-name>/src/test/resources

Note also that in the libraries tab in the same wizard, you should also
have the Junit 4 library.

Hope this helps
Luc

>
> Thanks,
> Eric
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Issue using git checkouts of commons(-math) in Eclipse

Eric Barnhill
Thank you Luc and Gilles, the issue is resolved.

pom.xml is throwing several errors but I will get to know Maven better, and
see if I can resolve them, before I post any issues.

Eric

On Thu, Oct 15, 2015 at 8:43 AM, Luc Maisonobe <[hidden email]> wrote:

> Hi Eric,
>
> Le 15/10/2015 00:13, Eric Barnhill a écrit :
> > When I check out the commons-math repo from git and import into Eclipse,
> > the package structure causes errors. Because the dir structure is
> > src/main/java/org/apache etc., Eclipse throws an error on all import
> > statements beginning with "org.apache" . It is looking for import
> > statements that begin with "main.java.org.apache" and offers to switch
> the
> > import statements.
> >
> > This happens whether I import the project as of Git type, or as of Maven
> > type.
> >
> > Does anyone know how to fix this?
>
> The packagage layout is a standard maven layout (you can check it
> from the command line). Eclipse should knows this layout already, so
> it seems strange it doesn't set the paths correctly.
>
> Anyway, you can set the paths manually from eclipse by right-clicking
> in the package explorer at project level and select in the context
> menu the entry: Build Path -> Configure Build Path.
>
> A popup wizard should appear, where you can select in the right-hand
> panel the tab "Source". This tab is used to configure the source folders
> to be included in the build path. The list of source folders that are
> needed for proper build and test is:
>
>   <project-name>/src/main/java
>   <project-name>/src/main/resources
>   <project-name>/src/test/java
>   <project-name>/src/test/resources
>
> Note also that in the libraries tab in the same wizard, you should also
> have the Junit 4 library.
>
> Hope this helps
> Luc
>
> >
> > Thanks,
> > Eric
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>