Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse with Subclipse behavior against Maven file structure is strange
Eclipse with Subclipse behavior against Maven file structure is strange [message #989398] Thu, 06 December 2012 04:52 Go to next message
David Luu is currently offline David Luu
Messages: 3
Registered: December 2012
Junior Member
Was wondering if anybody encountered this or have insight into the observed behavior.

We are setting up Selenium test framework, developing with Eclipse and compiling and running the tests through maven with our CI server.

As such, rather than muck with Maven integration with Eclipse or modifying Maven's default file structure to be Eclipse friendly, we decided to just adapt Eclipse for Maven, keeping the default Maven file structure so our test code is under

projectname/src/test/java

Don't ask why or suggest to use Maven integration with Eclipse or modify Maven settings, this post is just to talk about Eclipse behavior I observed.

So what we do is use Subclipse to checkout project to our local machines to work on.

So with our current setup, to get Eclipse to recognize Java packages correctly to start from src/test/java and rather than src (so it doesn't think packages are named test.java.yourpackagenamingfromhereon)

Our project lead designated that we checkout project from SVN as new Java project (via wizard) and specify SVN path that leads up to src/test/java and select "Use project folder as root for sources and class file" instead of "Create separate folders for sources and class files". It would appear that if you don't make this selection or specify SVN path to be root of project (e.g. parent of src) instead, then Eclipse fails to recognize the proper Java package hieararchy.

But what's interesting is if I use an external SVN client to checkout first to have a local repo, then use Subclipse and checkout from SVN as new Java project (via wizard), then instead of create new project in workspace as one typically does, select create project from existing source and select the local repo (at this point, project layout defaults to "Create separate folders for sources and class files", can't modify). Then finish the wizard, accepting prompts about any overwrites of the local repo, etc. The project imports successfully, and you get both Subclipse functionality to manage the codebase there (rather than use external SVN client anymore) and you get desired package referencing w/o having to resort to the workarounds my lead specified.

I also get the desired functionality not using Subclipse, using external SVN client, and importing/creating Java project with existing source, but this way, don't get the Subclipse functionality to manage SVN code inside Eclipse. Besides what I state above, I haven't yet found alternate way to checkout SVN code with Subclipse w/o having existing source to make it reference package correctly.

So I was wondering why does Eclipse w/ (or w/o Subclpse) behave this way? Why does creating project from existing source reference package starting at src/test/java while creating in workspace, etc. as new will make it reference from src?

Shouldn't it behave same either way? Maybe I'm missing some insight on the Eclipse Java project architecture.
Re: Eclipse with Subclipse behavior against Maven file structure is strange [message #989565 is a reply to message #989398] Thu, 06 December 2012 18:43 Go to previous messageGo to next message
David Luu is currently offline David Luu
Messages: 3
Registered: December 2012
Junior Member
I sent out the post a little early. Here's some additional info:

The setup described involved Subclipse v1.8.x, various versions of Eclipse (Europa, Indigo, Juno I think), TortoiseSVN v1.7.4, and using SmartSVN on Mac (forgot version # right now). So Subversion client used is generally v1.7.x.

Also wanted to mention we didn't run any special setup like maven export of Eclipse config (e.g. mvn eclipse:eclipse). We just import the directory structure as is into Eclipse via existing source on disk or via SVN checkout from Subclipse.

While I found this weird Eclipse behavior, looks like I found another way to import/setup Eclipse Java project from the Maven project keeping relative working paths the same w/o having to do Maven integration w/ Eclipse or export Eclipse config from Maven.
Re: Eclipse with Subclipse behavior against Maven file structure is strange [message #989596 is a reply to message #989565] Thu, 06 December 2012 22:18 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1024
Registered: July 2009
Senior Member
From a JDT point of view (without discussing peculiarities of different SVN clients) you simply need to define src/test/java as a source folder.
Note that Subclipse is not developed at Eclipse.org, so we can't advise you in that regard.
HTH,
Stephan
Re: Eclipse with Subclipse behavior against Maven file structure is strange [message #989621 is a reply to message #989596] Fri, 07 December 2012 01:23 Go to previous message
David Luu is currently offline David Luu
Messages: 3
Registered: December 2012
Junior Member
Thanks, makes sense. I filed issue 1471 in Subclipse project for them to look into (as an enhancement).
Previous Topic:Running 'NewLibraryPluginCreationOperation' in a headless application
Next Topic:Edit/Insert plist
Goto Forum:
  


Current Time: Thu Oct 30 12:32:51 GMT 2014

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

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