Having problems with the Eclipse plugin


Just wondering if anybodies been using the export plugin for Eclipse recently,
just tried installing it into Eclipse 3.1.2 so I can transfer an exsiting
Eclipse project into IntelliJ IDEA. When I right click on the package explorer
and click on export workspace to Intellij Idea I'm seeing a "com/intellij/eclipse/export/model/codestyle/Codestyle"
error message when I hit save/finish. Theres 40+ modules in this project..
I dont fancy trying to set it all up by hand.

ps. Anybody know if it'll handle custom build path - classpath variables?
the whole projects based on one of those.

- Richard


14 comments

Hello Richard,

RO> Theres 40+ modules in this project..
RO> I dont fancy trying to set it all up by hand.
RO>
RO> ps. Anybody know if it'll handle custom build path - classpath
RO> variables? the whole projects based on one of those.

You might want to try the eclipse workspace importer plugin. It does handle
custom build paths, although only one of them will end up being used per
module (while eclipse allows an output path per source path, IDEA limits
that to one per module).

HTH,
Andrei


0

Sound like a plan Andrei, but I'm not having much luck with the plugin either
- I give it the path to my workspace and hit "read eclipse projects" but
noting happens. This is the directory with the .metadata folder in it right?

Not seeing any errors reported in the idea.log file either.

- Richard


0

I have tried the plugin that *exports *the workspace from Eclipse. It didn't really work very well for me:

http://www.intellij.net/forums/thread.jsp?forum=27&thread=195885&tstart=45&trange=15

Although all the modules got copied and recreated in the IntelliJ project, many settings got lost/messed up and nothing compiled. I had to manually restore the paths and libraries. The bottom line, I don't think that plug-in is very useful for a serious (complex) real-life project.

I have also tried the other (un-official) plugin that imports an Eclipse workspace (vs. the w/s being exported out of Eclipse) - that Andrey is suggesting. That didn't work either. Somehow, I couldn't even pick the WS to import because the controls in the plugin windows (File->Import Eclipse Wopkspace) didn't work: you click on the controls and nothing happens. I assume the plugin settings conflicted with my IDEA environment. I didn't have time to mess with it, so I gave up on it and uninstalled the plugin. I'd be interested to hear some success stories though...

C

0

Hello Richard,

RO> This is the directory with the
RO> .metadata folder in it right?

Yep, that's the one. IDEA's status bar would say something about not finding
the .metadata directory if the path was not correct (not the best place to
put such error messages, I have to admit). Just curious, what OS are you
using (haven't tested it on anything else but windows, unfortunately).

Best,
Andrei


0

I had the same problem with that plugin. Hitting the button does not do enything. No eclipse workspaces found, no indication of any errors, anything.

0

I'm using windows too, nothing in the status bar and the workspace is correct I can see the eclipse project files if I keep drilling down.

0

Andrei,

I have tried to use your plugin, but with no luck at all. When I point it to the Eclipse workspace folder and click the "Read Eclipse Projects" button, the status bar displays the following message: "Reading workspace content from ]]>" but there is absolutely 0 CPU activity, nothing happens. How well have you tested the plugin? Perhaps you have some hardcoded values that make it work in your particular environment only? Any idea?

0

Hello Constantine,

CV> Andrei,
CV>
CV> I have tried to use your plugin, but with no luck at all. When I
CV> point it to the Eclipse workspace folder and click the "Read Eclipse
CV> Projects" button, the status bar displays the following message:
CV> "Reading workspace content from " but there is CV>]]> absolutely 0 CPU activity, nothing happens.

Hmm, not much happening there, not sure what the problem could be, to be
honest with you (and no, there are no hardcoded paths).
Could you try the following on a few of your directories?

1. Give it an invalid directory path - see if it's complaining that's not
a valid directory
2. Give it a valid directory path, but without a .metadata folder in in (not
an eclipse workspace) - should tell you it's not a valid eclipse workspace.

Could it have some problems accessing your workspace? (The only "magic" in
there is some looping through the directories and some ModuleManager invocations.)
You on windows/linux, are there any symlinks involved, mapped drives, stuff
like this?

Also, would it be possible to have a look at your eclipse workspace (just
the shells, the directories inside it, not the content)?

Best,
Andrei


0

Andrei, thanks for the reply. I had actually tried the things you are suggesting - pointing to an invalid folder or to a folder without the ".metadata" directory. The plugin displays an adequate error message in the status bar. However when I point to the correct workspace folder, the status bar tells me that the plugin is reading the workspace, but nothing happens. There's nothing unusual about the Eclipse workspace in question, really (please see the attached dir tree.)

For now, I have recreated the workspace in IntelliJ manually. It took me a few hours (l3 projects : 1 Java, 1 WebApp, and 11 EJBs) to configure the libs, deployment settings, etc. It would certainly be very helpful if one could just import complex Eclipse projects with a click or two. So, thanks for looking into this. Such plugin would definitely be very helpful!

BTW, I see that JetBrains have not even included the reference to their "export-out-of-Eclipse" plugin into the help doc for Demetra. Are they abandoning this feature?



Attachment(s):
ews-dir.JPG
0

Hello Constantine,


CV> For now, I have recreated the workspace in IntelliJ manually. It
CV> took me a few hours (l3 projects : 1 Java, 1 WebApp, and 11 EJBs) to
CV> configure the libs, deployment settings, etc. It would certainly be
CV> very helpful if one could just import complex Eclipse projects with
CV> a click or two. So, thanks for looking into this. Such plugin would
CV> definitely be very helpful!

Yeah, I know. At my previous job almost everybody else was using eclipse,
and there were >100 projects in that structure, that's how this thing was
born (especially since the structure was in constant change).

As for your problem, the answer is quite simple, really. :)

The structure I was used to (mind you, I'm no eclipse guru, since I avoided
it as much as I could) had the projects on the same level as the .metadata
directory. From what I can see your eclipse structure contains nothing but
the metadata directory, am I to understand your sources are inside it? Is
this a standard structure (if so, I should probably enhance the logic to
deal with it as well).

So here's what the plugin does: it looks into the eclipse workspace and attempts
to create a module for each one of the projects except the metadata one
(which is used only for "validating" the workspace). It actually gives you
options for creating a module for each one of those projects, more precisely.
So in your case it understands the structure as an empty workspace (a valid
one, though, due to the .metadata directory).

If your sources are somewhere inside the .metadata, here's a simple workaround
that would allow you to move forward: create another directory called ".metadata"
alongside your eclipse projects directories, and give its parent as your
eclipse workspace (this is just so the plugin does not complain about an
invalid workspace path). So, for

C:\wksp\.metadata\projectsHere
C:\wksp\.metadata\projectsHere\proj1
C:\wksp\.metadata\projectsHere\proj2
C:\wksp\.metadata\projectsHere\.metadata (create this dummy one here)

Use C:\wksp\.metadata\projectsHere as your eclipse workspace.

And please do send over any other feedback you might have. While I don't
have to use the plugin anymore (for a while, at least), I don't mind updating
it so it can take care of cases I have not had to deal with.

Best,
Andrei


0

Andrey, thanks! I am afraid there may be more to the issue than this... The workspace you saw in the attachment is created by MyEclipse. Since I am no Eclipse expert either, I can't say for sure whether that explains the difference with the project structure you are familiar with. As you could see, the projects are placed under ".metadata\.plugins\org.eclipse.core.resources\.projects" Each specific project folder within ".projects" contains two subdirectories with the following content:

.indexes
- properties.index
.org.eclipse.jdt.core
- state.dat

Those are obviously binary files. Naturally, the actual sources are elswhere, because the WS configuration does not have to be stored under the source root. I am not sure that your plugin will be able to actually decode the type of data stored under ".projects". I am guessing, it worked fine in your particular case because the actual source files were stored under the same root with the workspace config data. Hmmm... Does your plug in actually pick up all libraries and module dependancies? What about the deployment configuration for WebApps, EJB modules, etc? I understand that Eclipse stores all that stuff in a binary form...

C



0

Hello Constantine,

Nope, sorry, my eclipse stuff is not covered. The plugin takes care of the
following:
- libraries as defined in .classpath files and osgi bundles manifest files
(inlcuding eclipse implicit libraries or additional osgi bundles in other
directories). It flattens the library dependencies graph for the osgi bundles
structure into a list of libraries in IDEA.
- project dependencies as defined in the above files
- source, output and excluded paths
- creates web modules for eclipse projects with WSAD web perspectives and
WTP info files (but does not attempt to import the deployment configuration).

Pointing it to where you have the sources (presuming you create the dummy
.metadata directory) could get you as far as importing the libraries, along
with module dependencies (based on the .classpath files and the manifest
files if you keep your projects as osgi bundles). The web/ejb deployment
configuration would have to be done by hand.

Note that you can run it repeatedly over the same structure. It will update
(the default setting) your module files, so you don't lose your additional
settings. This is useful if new stuff is constantly added to the eclipse
workspace and you don't want to hunt changes by hand.

HTH,
Andrei




0

Sounds like your plugin generally does what the stuff similar to the IntelliJ's packaged "Eclipse plugin" that runs from within Eclipse and generates an IDEA project file. I had tried it once but got mixed results: it generated the modules but messed them up pretty good (I had to reconfigure the libs and deployment stuff by hand.) So it didn't save me much time.

I would recommend adding your comments to the plugin description. It would be very helpful to all those who download it. Good work!
Cheers,
C

0

Hello Andrei,

The structure I was used to (mind you, I'm no eclipse guru, since I
avoided it as much as I could) had the projects on the same level as
the .metadata directory. From what I can see your eclipse structure
contains nothing but the metadata directory, am I to understand your
sources are inside it? Is this a standard structure (if so, I should
probably enhance the logic to deal with it as well).


Ah! this'll be why it didnt work for me either. The Eclipse project I'm working

with is external to the workspace - moreover thr project files for each an
every
one of its eclipse modules are tucked away under a subdriectory structure
of its
own making.

Guess I'm completely out of luck here then - trying to migrate this structure

into the workspace one would involve rewriting the build scripts which are
way too complex.

As to the offical Eclipse plugin I couldnt even get it to run:
http://www.jetbrains.net/jira/browse/IDEA-6861 - maybe its the same
problem? I'd only installed eclipse an the plugins to migrate the project
otherwise my eclipse workspace is completly empty.

- Richard


0

Please sign in to leave a comment.