Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There is already a page that describes how to get started with Eclipse by building a new Tuscany SCA project from scratch. How do you though use the various existing samples and examples that are provided with Tuscany from within Eclipse. ? Here we'll provide some instructions about how to do just that for both the Maven user and the non-maven Maven user. As an example well look at how to import the introducing-trips contributions and the jumpstart launcher that runs it from the Tuscany SCA Travel Sample. These instructions assume that the projects have already been compiled using Maven or Ant. This is important because some of the source of the modules is generated during the compile stage and we need to import that into Eclipse along with the other source code and resources that the projects contain.

1 - For the Maven user

1.1 - Creating Eclipse project files

...

Code Block
Select Window/Preferences
From the resulting “Preferences” dialog select Java/Build Path/Classpath Variables
Select the “New…” button
In the “Name:” field type M2_REPO
In the “Path:” field type <path to your maven repo>

1.3 - Loading

...

an existing project into Eclipse

Once M2_REPO is set you can load the project into Eclipse

...

The project should now appear in your workspace.

1.4 - Running the sample

Now you have introducing-trips loaded you can repeat the process for the launchers/jumpstart module. Repeat step 1.1 for launchers/jumpstart and then load it into eclipse with step 1.3. You don't need to repeat step 1.2 as it will remain set.

Now open up the scatours-launcher-jumpstart project in Eclipse (the project name comes from the Maven module name specified in the pom.xml file) and look for the JumpstartLauncher.java file. If you right click on that file and select Run As Application the sample should run.

2 - For the non-Maven user

Maven gives a fair bit of help in creating Eclipse projects from existing project. Most of the effort is involved in working out what the dependencies are. Without Maven we need to make all of the Tuscany libraries available to the SCA projects we load into Eclipse. We're going to do this by creating a TUSCANY library variable. Once we have this set we can create new projects, load existing resources into them and associate them with the TUSCANY variable so that all the dependencies are satisfied.

2.1 - Setting up the TUSCANY library