Maven / eclipse / SVN

1 view
Skip to first unread message

Rowan Seymour

unread,
May 17, 2012, 7:46:57 AM5/17/12
to d...@openmrs.org
This is how I create a Maven project and get it setup in eclipse and committed to an SVN repo. I figure I must be doing the whole Maven / SVN / eclipse thing wrong because it's so complicated:
  1. Generate module using module-wizard
  2. Build it with Maven as eclipse won't import the api/omod modules properly as Java projects unless I do this first
  3. Import it into eclipse as an existing Maven project
  4. From eclipse share it as an SVN project
  5. Add source files to SVN and commit, carefully deselecting all eclipse specific files and Maven target directory contents
  6. Use eclipse navigator view to add eclipse specific files and Maven target directories to svn:ignore
  7. Commit again to get svn:ignore changes saved
  8. But api/omod subprojects aren't picked up as SVN projects so don't have indicator icons. Rename projects to something and then back so that eclipse detects them as SVN projects
There must be an easier way? Subversive? Another IDE? I'm also finding that projects regularly stop showing as SVN projects or get random SVN icons.

Rowan

Ben Wolfe

unread,
May 25, 2012, 8:52:08 AM5/25/12
to d...@openmrs.org
I use subclipse and have no problems with random icons, etc.  Perhaps you have a buggy version of the plugin or mix of subclipse+eclipse? 

I think eclipse ships with subversive these days, so it might be the preferred plugin going forward.

I think you have to do step #2 below because of a bug in the maveneclipse plugin that doesn't see the "omod" type maven project as a java project.  (omod is defined in a maven plugin in the omod/pom.xml file)  If you drop a .classpath file into project it magically becomes a java project in eclipse.  I updated the basic module to be a "java" project instead of an "omod" project.  Perhaps the archetype doesn't have that change yet?

Yes, committing a new project to svn is two steps for some reason:
1) Share project (commits top folder)
2) Commit on top level folder actually sends all files.

You should also svn:ignore all files that shouldn't be in there: **/target/*, **/.classpath, and **/.project.  You can do this in one commit instead of two by doing an "add files to svn" and then choose "svn:ignore" on the right folders.  But doing 3 commits is just about as easy as 2 and that procedure. :-)

Number 8 is a subclipse bug.  I have seen it occasionally when importing for the first time and just close/reopen the project in eclipse and it gets picked up.

I don't know that you're doing anything wrong.  If a few bugs were eliminated you could have a 4 step process instead of 8, but its still a process.

Ben


Click here to unsubscribe from OpenMRS Developers' mailing list

Reply all
Reply to author
Forward
0 new messages