Skip to content

Working on the project using Eclipse

arigesher edited this page Dec 21, 2011 · 8 revisions

Disclaimer: Palantir Technologies is not affiliated with, endorsed or sponsored by Palantir.net, Inc. Palantir.net's website is http://palantir.net

Palantir Logo

Eclipse integration is pretty easy to get going and may require two steps.

Configuring your workspace to use the local Maven Repository

Note: you only need to do this once for each Eclipse workspace (not project) that will use Maven artifacts in its classpath. It's idempotent, so there's no harm in doing it on a workspace where it's already been run.

  1. go to where you have cloned Cinch
  2. Make sure Eclipse is not currently running
  3. Run a build using maven: mvn - this will ensure that all dependencies have been downloaded
  4. Run the maven Eclipse setup task: mvn eclipse:configure-workspace -Declipse-workspace=/path/to/your/workspace (note: depending on your version of maven, the property may be called eclipse.workspace - consult the maven output to figure out which one is the right one)
  5. Fire up Eclipse and confirm that the M2_REPO classpath variable is set properly: Eclipse Classpath Setup Screenshot

Here's example output from running these commands. Note that the first time you run them, they may produce substantially more output as maven downloads its needed plugins and dependencies from the maven repos:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Palantir Technologies Cinch Java Binding Framework 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-eclipse-plugin:2.8:configure-workspace (default-cli) @ ptoss-cinch ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.292s
[INFO] Finished at: Wed Dec 21 12:29:50 PST 2011
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------

Configuring your Cinch checkout

  1. Go to where you cloned Cinch
  2. run mvn eclipse:eclipse - this will write the classpath info to your .project and .classpath files
  3. Make sure to refresh / open & close the project in Eclipse to pick up the changes

Here's sample output from running this command - as usual, if it's the first time you're running this, maven may spit out substantially more output as it downloads and installs the necessary plugins:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Palantir Technologies Cinch Java Binding Framework 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-eclipse-plugin:2.8:eclipse (default-cli) @ ptoss-cinch >>>
[INFO] 
[INFO] --- build-helper-maven-plugin:1.7:add-source (add-source) @ ptoss-cinch ---
[INFO] Source directory: /Users/regs/work/opensource/cinch/example added.
[INFO] 
[INFO] <<< maven-eclipse-plugin:2.8:eclipse (default-cli) @ ptoss-cinch <<<
[INFO] 
[INFO] --- maven-eclipse-plugin:2.8:eclipse (default-cli) @ ptoss-cinch ---
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
[INFO] File /Users/regs/work/opensource/cinch/.project already exists.
       Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed.
[INFO] Wrote Eclipse project for "ptoss-cinch" to /Users/regs/work/opensource/cinch.
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.966s
[INFO] Finished at: Wed Dec 21 12:30:51 PST 2011
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------