You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Eric Barnhill <er...@gmail.com> on 2015/10/15 00:13:57 UTC

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

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

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

Posted by Eric Barnhill <er...@gmail.com>.
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 <lu...@spaceroots.org> 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: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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

Posted by Luc Maisonobe <lu...@spaceroots.org>.
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: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


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

Posted by Gilles <gi...@harfang.homelinux.org>.
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: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org