Skip to content

Creating new provider with Maven

prubach edited this page May 21, 2013 · 2 revisions

Table of Contents

Creating new provider with Maven

Prerequisites

  • Java 1.6
  • Maven 3.0
  • Eclipse with m2e (maven) plugin
  • Sorcer distribution
  • (before official Sorcer release) Maven settings.xml updated for Sorcer

Creating the project (archetype version 1.0.0-alfa-3)

  1. Go to directory which will be the parent of your new project
  2. Call maven to use the archetype
    mvn archetype:generate -DarchetypeGroupId=org.sorcersoft.sorcer -DarchetypeArtifactId=sorcer-provider
    or
    mvn archetype:generate -Dfilter=org.sorcersoft.sorcer:
  3. Answer questions:
    1. groupId: Usually you organisation's reversed domain name, e.g. com.sorcersoft
    2. artifactId: Project name and project directory name, e.g. myprovider1
    3. package: Java package for your provider classes, by default groupId is used
    4. providerClass: Java class name of your provider
    5. serviceDescription: Description of your provider. Value will be used in service browser
    6. serviceName: The name of your service
  4. Confirm properties configuration

    This is the time to accept or modify all values, including the default ones. If everything is OK, press Y.

  5. Import your maven projects to eclipse
  6. You may remove the -sui (service UI) project if you're not going to use a graphical user interface in your provider. You may also remove the -proxy project if your provider is going to use a thin client proxy. Don't forget to remove the corresponding <module> entry from pom.xml after you remove the module itself.

Starting provider

  1. Start Sorcer
  2. Start provider (from console in project directory):
    ant -f [serviceName]-prv/boot.xml

Testing provider

To test your provider start sample requestor (client):

 ant -f [serviceName]-req/run.xml