Home » Language IDEs » Java Development Tools (JDT) » Getting from SVN to JDT
Getting from SVN to JDT [message #257760] |
Thu, 11 December 2008 19:26  |
Eclipse User |
|
|
|
I connected to a subversion/svn repository and can now access some open
source code from a remote location.
I want to make a modification to a class and save/compile/deploy it
locally.
How to I get from (copy) code from an SVN location to be able to work with
it locally in the J2EE perspective?
|
|
|
Re: Getting from SVN to JDT [message #257764 is a reply to message #257760] |
Thu, 11 December 2008 20:18   |
Eclipse User |
|
|
|
John Bailo wrote:
>
> I connected to a subversion/svn repository and can now access some open
> source code from a remote location.
>
> I want to make a modification to a class and save/compile/deploy it
> locally.
>
> How to I get from (copy) code from an SVN location to be able to work
> with it locally in the J2EE perspective?
Subversion lets you view code remotely in a web browser, but to work
with the code, you need to check out the code into a local enlistment,
that is, a directory on your machine. Then you'll make changes locally
and, eventually, commit your changes back to the repository.
You can do this with SVN at the command line, but I'd suggest using the
Subclipse plugin, which integrates SVN functionality into Eclipse. I
think you have to install the command-line version of SVN in order to
use Subclipse, but maybe not; I use both so I don't know :-) You can
find SVN and Subclipse via Google; they are not part of the Eclipse
project, so you won't find them on eclipse.org.
If you have SVN installed on your machine, and you type 'svn help', it
will give you a list of possible commands. There is also, of course,
documentation. In general, I use 'svn co <repository-url> <target-dir>'
to check out code; 'svn ci -m "<check-in message>"' to commit changes;
and 'svn stat' to see what I have checked out. Or, courtesy of
Subclipse, I use the Team menu inside Eclipse, and the Synchronize view,
just the same as with CVS.
None of this actually has anything to do with JDT; so, you might want to
direct subsequent queries to the 'eclipse.newcomers' group, or even
better, to the Subversion or Subclipse plugins.
|
|
|
Re: Getting from SVN to JDT [message #257774 is a reply to message #257764] |
Thu, 11 December 2008 21:36   |
Eclipse User |
|
|
|
Thanks, I should have said, I am using the SVN plugin for Eclipse.
So, I have been successful in attaching to the server, and can see the
code via Eclipse.
However, my question is what to do next.
Or am I supposed to work in the SVN Perspective for development?
If, not, and say I want to now build/compile my SVN source in Eclipse JDT,
how do I relate the two to each other?
So it's really a JDT question for how to pull SVN source into a JDT
project.
(I should add, I don't want to necessarily make contributions to the SVN
project, but just to get the source code and make some modifications
specific to my application).
|
|
| |
Re: Getting from SVN to JDT [message #257785 is a reply to message #257774] |
Fri, 12 December 2008 13:54  |
Eclipse User |
|
|
|
"John Bailo" <John.Bailo@Bowne.com> wrote in message
news:3f23cd414873301b668fa32f11c2dede$1@www.eclipse.org...
>
> Thanks, I should have said, I am using the SVN plugin for Eclipse.
>
> So, I have been successful in attaching to the server, and can see the
> code via Eclipse.
>
> However, my question is what to do next.
>
> Or am I supposed to work in the SVN Perspective for development?
>
> If, not, and say I want to now build/compile my SVN source in Eclipse JDT,
> how do I relate the two to each other?
>
> So it's really a JDT question for how to pull SVN source into a JDT
> project.
>
> (I should add, I don't want to necessarily make contributions to the SVN
> project, but just to get the source code and make some modifications
> specific to my application).
There are a lot of different possible workflows, and I suggest that some
time with documentation is going to help you understand the possibilities.
It really depends on details - for instance, whether the project in SVN is
already an Eclipse project or a Maven project (or both) or just a plain Java
project with no metadata.
The workflow that I often use for projects that do not have Eclipse metadata
(such as a .project file) in the repository is this:
1. I check out the project, using SVN at the command line, into some
directory - let's say, ~/dev/proj.
2. In Eclipse, I right-click the Project Explorer view and say Import As...
Java Project. This will create a .classpath and .project file for Eclipse,
which I may need to edit (by, for instance, changing the Java Build Path).
Note that if the project was a Maven project, I would have done Import As...
Maven Project, using the M2Eclipse plug-in, and that would set up the
..classpath properly; plain Java projects with no metadata are harder.
3. The Subclipse plug-in will recognize that version control is active on
the project and connect it accordingly so that features in the Team menu
work properly (such as Revert, Commit, and so forth).
In step 1, I imagine it is also possible to use the Subversion Repositories
view to define some repos, and then you'll be able to see the contents of
the repo and check them out directly, within Eclipse, automatically creating
a Java project at the same time. However, that doesn't happen to be the
workflow I use, in my development environment.
|
|
|
Goto Forum:
Current Time: Sat Apr 26 08:16:29 EDT 2025
Powered by FUDForum. Page generated in 0.02863 seconds
|