Maven archetype

Use a Maven archetype to create a custom endpoint project.

The AutoSync SDK project template is available as a Maven archetype. The archetype creates the directory structure for project source and build files. The project includes two examples:

  • The SimpleGoogleSheets source endpoint

  • The SimpleSnowflake target endpoint

Because Maven version 3.0.0 removed the ability to reference a remote non-central archetype catalog, we created the AutoSync archetype with the version 2.4 plugin. Refer to ARCHETYPE-519 for more details.

Prerequisites

  • Java Development Kit (JDK) 11 or higher
  • Maven

Use the archetype

The AutoSync SDK archetype, com.snaplogic.tools:autosyncendpoint-archetype, is available from the SnapLogic JFrog repository. You can use the archetype from the command line or from an IDE with Maven support. Refer to your IDE documentation for details. The following steps describe how to use the archetype from the command line:

  1. Create a directory for the project.
  2. Use a terminal or command window to navigate to the project directory.
  3. Run the mvn command to list the SnapLogic archetypes:
    mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://snaplogiceng.jfrog.io/artifactory/thirdparty/

    Wait for the downloads.

  4. After the Choose archetype group displays the available archetypes, enter the following values for the prompts:
    1. Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :: 2
    2. Define value for property 'groupId': com.snaplogic.autosyncendpoint
    3. Define value for property 'artifactId': : testcustomendpoint
    4. Define value for property 'version': 1.0-SNAPSHOT: : Press Return to accept the default.
    5. Define value for property 'package': com.snaplogic.autosyncendpoint Press Return to accept the default.
    6. Confirm properties configuration:
                  groupId: com.snaplogic.autosyncendpoint
                  artifactId: testcustomendpoint
                  version: 1.0-SNAPSHOT
                  package: com.snaplogic.autosyncendpoint Y: :   
      Press Return to confirm.
  5. Change to the testcustomendpoint directory.
  6. Run the following command: mvn -s settings.xml clean install.

After you finish development, use the mvn package command to bundle the artifacts in a ZIP file. From Classic Manager, upload the ZIP file to the top level shared folder. AutoSync reads the bundle and exposes the custom endpoint in the user interface.

Next, learn more about the Project folder structure.