Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse + svn/subclipse + apache dir structure
Eclipse + svn/subclipse + apache dir structure [message #142892] Tue, 14 March 2006 10:22 Go to next message
Eclipse UserFriend
Originally posted by: chrisg.paper-river.com

Hi,

We've got a few java projects submitted to svn which have dependancies on
each other. These projects are built in an apache directory structure with
src/build/resources/dist folders and an ant build file at the root.

If I checkout the whole trunk of the svn, which includes all the projects
into Eclipse, then the ant scripts run fine, and projects can compile etc.
However, none of the projects seem to be registered as Java projects, and
therefore none of the editing tools work such as code completion, the '.'
notation to access methods etc, or finding the declarations of objects etc.

After doing some searching, i checked out each project individually into the
workspace, and i checked them out as Java projects. This also allowed me to
set the src and build paths to the correct ones in the file structure.

This now allows me to edit them like normal java projects using standard ide
tools.

However, I now dont have the common ant build file in the root folder, which
is referenced by each of the projects, therefore ant doesnt work.

Has anyone been able to set up eclipse with this kind of file structure, but
still treat each individual project folder as a java project?

I guess what i need is to be able to have "sub-projects" under a main
'trunk' project.

Any help is appreciated!!

Chris
Re: Eclipse + svn/subclipse + apache dir structure [message #142912 is a reply to message #142892] Tue, 14 March 2006 10:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mynewsgroup.web.de

Chris Gates schrieb:
> Hi,
>
> We've got a few java projects submitted to svn which have dependancies on
> each other. These projects are built in an apache directory structure with
> src/build/resources/dist folders and an ant build file at the root.

Did you check in the .project and .classpath files to the root folder of
each subproject as well? Subclipse is aware of this file an configures
the nature and the buildpath of a project automatically when checking it
out.


> If I checkout the whole trunk of the svn, which includes all the projects
> into Eclipse, then the ant scripts run fine, and projects can compile etc.
> However, none of the projects seem to be registered as Java projects, and
> therefore none of the editing tools work such as code completion, the '.'
> notation to access methods etc, or finding the declarations of objects etc.

Your projects do not have the Java nature.
Is your repository structure like this:
....myproject/trunk/
subproject1/src/...
subproject2/src/...
and with a build.xml, .project and .classpath in each subprojectX folder?

Do you checkout the single trunk folder (...myproject/trunk) or each
project-folder that is in the trunk-folder? I think you have to do the
latter because Subclipse assumes .project to be in the top-level folder
that is checked out. So you need to select .../subproject1,
..../subproject2 (a multi selection is possible) for checkout instead of
only trunk. Then a Java project is created for each checked out folder
and given the name from .project and the buildpath from .classpath.


Regards
Sebastian
Re: Eclipse + svn/subclipse + apache dir structure [message #142930 is a reply to message #142912] Tue, 14 March 2006 12:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chrisg.paper-river.com

"Sebastian Scheid" <mynewsgroup@web.de> wrote in message
news:dv677o$nu$1@utils.eclipse.org...
> Chris Gates schrieb:
>> Hi,
>>
>> We've got a few java projects submitted to svn which have dependancies on
>> each other. These projects are built in an apache directory structure
>> with
>> src/build/resources/dist folders and an ant build file at the root.
>
> Did you check in the .project and .classpath files to the root folder of
> each subproject as well? Subclipse is aware of this file an configures the
> nature and the buildpath of a project automatically when checking it out.
>
>
>> If I checkout the whole trunk of the svn, which includes all the projects
>> into Eclipse, then the ant scripts run fine, and projects can compile
>> etc.
>> However, none of the projects seem to be registered as Java projects, and
>> therefore none of the editing tools work such as code completion, the '.'
>> notation to access methods etc, or finding the declarations of objects
>> etc.
>
> Your projects do not have the Java nature.
> Is your repository structure like this:
> ...myproject/trunk/
> subproject1/src/...
> subproject2/src/...
> and with a build.xml, .project and .classpath in each subprojectX folder?

Yes.

>
> Do you checkout the single trunk folder (...myproject/trunk) or each
> project-folder that is in the trunk-folder? I think you have to do the
> latter because Subclipse assumes .project to be in the top-level folder
> that is checked out. So you need to select .../subproject1,
> .../subproject2 (a multi selection is possible) for checkout instead of
> only trunk. Then a Java project is created for each checked out folder and
> given the name from .project and the buildpath from .classpath.

Initially i was trying to checkout the single trunk folder. Doing it this
way allows all the build files to work correctly.

I then tried checking out each project folder. After setting up the
libraries, this lets me edit the code like normal, and eclipse can build the
files and everything, but the ant build files no longer work. I beleive that
this is because they are missing the common build file that is located in
the trunk folder, and so therefore has now not been checked out. I cannot
check this out into the workspace to be at the root of the projects, like it
is when checking out the whole of the trunk Is there anyway of adding this
common build file, or is the only course of action to edit each of the
project build files to incorporate the elements of the common one?

Thanks

Chris
>
>
> Regards
> Sebastian
Re: Eclipse + svn/subclipse + apache dir structure [message #142940 is a reply to message #142930] Tue, 14 March 2006 13:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mynewsgroup.web.de

Chris Gates schrieb:
[...]
> Initially i was trying to checkout the single trunk folder. Doing it this
> way allows all the build files to work correctly.
>
> I then tried checking out each project folder. After setting up the
> libraries, this lets me edit the code like normal, and eclipse can build the
> files and everything, but the ant build files no longer work. I beleive that
> this is because they are missing the common build file that is located in
> the trunk folder, and so therefore has now not been checked out. I cannot
> check this out into the workspace to be at the root of the projects, like it
> is when checking out the whole of the trunk Is there anyway of adding this
> common build file, or is the only course of action to edit each of the
> project build files to incorporate the elements of the common one?

Perhaps it helps to check out the trunk so you have only one eclipse
project containing the subprojects and then define the subprojects src
folders as Source Folders (right-click subproject/src folder->Build
Path->Use as Source Folder). This only works if the checked out project
(from trunk) has the Java nature. If your trunk does not contain a
..project file, you have to checkout with the New Project Wizard and
create a Java project.
After you have configured your build path and included all subprojects
src folders, you can checkin .project and .classpath to the trunk so you
don't need to do that work again and can share your project settings.

Regards
Sebastian
Re: Eclipse + svn/subclipse + apache dir structure [message #142950 is a reply to message #142940] Tue, 14 March 2006 14:17 Go to previous message
Eclipse UserFriend
Originally posted by: chrisg.paper-river.com

....
> Perhaps it helps to check out the trunk so you have only one eclipse
> project containing the subprojects and then define the subprojects src
> folders as Source Folders (right-click subproject/src folder->Build
> Path->Use as Source Folder). This only works if the checked out project
> (from trunk) has the Java nature. If your trunk does not contain a
> .project file, you have to checkout with the New Project Wizard and create
> a Java project.
> After you have configured your build path and included all subprojects src
> folders, you can checkin .project and .classpath to the trunk so you don't
> need to do that work again and can share your project settings.
>
> Regards
> Sebastian

That did the job - setting the individual src folders was exactly what i
needed to know.

Thanks very much for all your help.

Chris
Previous Topic:Key word or preserved word
Next Topic:can't execute an applet that's inside a package
Goto Forum:
  


Current Time: Thu Apr 25 02:26:20 GMT 2024

Powered by FUDForum. Page generated in 0.08020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top