Re: Directory structure for project in Eclipse using Subclipse

"Mark Kempster" <[email protected]>
Newsgroups gmane.org.user-groups.trijug.juglist
Message-ID <[email protected]>
I have to admit being in the anti-subclipse camp. I use subversion and
eclipse for all of the projects I'm working on, and all are different.
I -do- include subclipse with my eclipse environments, but it's mostly
just to filter out all the subversion metadata business - I never
checkin with subclipse (until recently, that is).

For my current personal project, I'm using eclipse / subversion /
maven. I'm no longer checking in any 'bin' directories, nor any
eclipse project files. Instead, I use the regular ol' subversion
structure that was mentioned earlier (/trunk /branches /tags with
/branches/foo and /tags/bar being snapshots of /trunk at a point in
time) and let maven (or the m2eclipse plugin) do all the eclipse
environment building for me.

To use just maven, I do something like this

cd personal-proj-trunk
mvn eclipse:eclipse

That builds the eclipse .project and .classpath files. Then fire up
eclipse and 'Import existing eclipse project'.  It creates binary
output directories and all that - which happen to be in subversion's
ignore list.

(I tend to do this every time I have to checkout something new -
trunk, branch or tag. It makes all the eclipse workspace-building
business less painful. I typically create a new workspace, and use
'mvn eclipse:add-maven-repo' to get the workspace in the right shape -
http://maven.apache.org/guides/mini/guide-ide-eclipse.html. I still
haven't got my head around the multiple-working-set idea yet, which is
probably part of my problem.)


Going the m2eclipse route, I just 'Import Maven Project' and it seems
to end up about the same spot.

When doing checkins, I normally prefer the command-line (cygwin,
xterm...). But of late I've started to use mylyn (which interacts with
subclipse or some other svn library - not sure which)  to do that,
with moderate success.

I can't stand checked-in directories for binaries and eclipse project
files (to allow folks to use whatever ide they prefer). But it's the
way things are for my day job (where we've standardized on eclipse).

I'm still not convinced that maven's really 'all that', but it makes
project setup pretty easy.

- Mark

On Fri, Oct 3, 2008 at 6:02 PM, Richard O. Hammer <[email protected]> wrote:
> Tim,
>
> Thank you.  I am still having trouble making sense of this.  Do you keep
> track of tags?  And if so would you suggest a separate Eclipse project
> for each tag?
>
> Do you use Subclipse's mechanism to "Configure Branches/Tags"?  (found
> in the context menu for a project -> Team -> Configure Branches/Tags)
>
> Subclipse keeps on making directories in places that seem wrong to me.
> I am wondering if it would be easier to forget Subclipse and do all my
> version control from a command prompt.
>
> Thanks again,
> Rich Hammer
>
>
> Uttormark, Tim wrote:
>> Assuming that you are using the "standard/suggested" setup for branching
>> in subversion, each directory under "branches" should represent the
>> entire content of "trunk" at a different point in time.
>>
>> What you want then is one Eclipse project for trunk, and another for
>> each branch.  The Eclipse .project and .classpath files go immediately
>> under the trunk and branch directories, and are versioned along with the
>> branch.  For instance, the set of jars can change over time; this is
>> reflected in a change to the .classpath file in each branch/trunk.  You
>> would not want to try to share one .classpath across branches as it
>> could not account for this.
>>
>> So:
>>
>> projectHome_current (maps to SVN trunk, represents V3 in my example)
>>   - src
>>   - bin
>>   - .project
>>   - .classpath  (has jars needed for current [V3] build)
>>
>> projectHome_v1 (maps to SVN branches/v1_branch)
>>   - src
>>   - bin
>>   - .project
>>   - .classpath  (has jars needed for v1 build)
>>
>> projectHome_v2 (maps to SVN branches/v2_branch)
>>   - src
>>   - bin
>>   - .project
>>   - .classpath  (has jars needed for v2 build)
>>
>>
>> -- Tim Uttormark
>>    Principal Java Architect, Peopleclick
>>
>>
>>
>> -----Original Message-----
>> From: [email protected] [mailto:[email protected]] On
>> Behalf Of Richard O. Hammer
>> Sent: Friday, October 03, 2008 1:52 PM
>> To: Java Users Group
>> Subject: [Juglist] Directory structure for project in Eclipse using
>> Subclipse
>>
>> I am trying to figure out how to set up a project in Eclipse that will
>> use Subversion through the Subclipse plug-in.  I want a directory
>> structure that is logical and useful.
>>
>> The documentation I see suggests using three directories under the
>> project home, one each for: trunk, branches, and tags.  But how does
>> that relate to the src and bin directories Eclipse likes to use?  Are
>> all five of those in the project home?  Or is there some way to set up
>> Eclipse to recognize a structure like this:
>>
>> projectHome
>> - trunk
>>    - src
>>    - bin
>> -tags
>> -branches
>>
>> Or am I supposed to have a top level package named "trunk" in a
>> structure like this:
>>
>> projectHome
>> -src
>>   - trunk
>>   - tags
>>   - branches
>> -bin
>>
>> What works?
>>
>> Thank you,
>> Rich Hammer
>>
>> _______________________________________________
>> Juglist mailing list
>> [email protected]
>> http://trijug.org/mailman/listinfo/juglist_trijug.org
>>
>>
>
>
> _______________________________________________
> Juglist mailing list
> [email protected]
> http://trijug.org/mailman/listinfo/juglist_trijug.org
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.