0

I need to write some Unit-Tests for google guava 15 (for an online course). There is a semi-automatic tool involved that reads the source code and executes it with the help of eclipse. So I need readable source code (not only the binary classes) that can be run from within an unittest.

So here is what I did:

  • cloned github repo via egit
  • Import from git -> local repository -> general project (I tryed new java project and the new project wizard but that created empty folders, only with general project the source was at least visible within eclipse)
  • went back in git history to guava version 15

But it seems that he doesn't build the java project now (of course because its a general project). I found some answers to this topic: editing the .project from eclipse to change the general to a java project but that did not work, maybe I did it wrong).

But is there an easy way to do this? Maybe by using a build tool or something? Seems to be very complicated to edit the .project for a complex project like guava, only telling him that this is a java project does not work!?

alloisxp
  • 175
  • 3
  • 16
  • Did you check the project's build path? Check if the guava sources are available (e.g. as .jar which is the usual distribution form of guava) – Julian L. Sep 29 '15 at 10:05

2 Answers2

1

Guava is designed to be built using the Maven build tool.

If you want to do this within Eclipse, the M2E plugin implements Maven integration. It knows how to import a Maven source tree as an Eclipse Java project, including setting up the ".project" file and other stuff that Eclipse needs.

Here's how to install it: Maven in Eclipse: step by step installation

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
0

This is somewhat detailed answer on how to get a Maven project in Eclipse working and manage it by EGit. It describes almost the same situation.

Community
  • 1
  • 1
Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28