Run Analytics Maven Targets from the Command Line

You can build, synchronize, deploy and undeploy your analytics project from the command line using Apache Maven.

Export your application:

  1. Go to your IoT application and select Analytics.
  2. Select IDE Support.
  3. Click Export Project to IDE.
    A zip file named project-ide-export.zip is downloaded to your Downloads folder.
  4. Move the exported project file to a folder of your preference and unzip it.
    The exported project has the following folder structure:
    • src: Contains the sources for your analytics processors.

    • bacs: Contains the metadata for project. Do not edit this metadata using an IDE, instead use the Management Console.

    • maven:: Contains an embedded Apache Maven installation with all the settings for this project.

Run the Maven targets from the command line:

  1. Open the command line and change directories to the directory of your exported project.
  2. Run the maven script located at project-ide-export/maven/bin/mvn with a Maven target.
    For example:
    $maven/bin/mvn package
    For a list of the available Maven targets, see Understand Apache Maven Targets for Analytics.
    To synchronize, deploy, or undeploy your project you must specify the credentials to access Oracle Internet of Things Cloud Service using the following command line arguments:
    • iot.client.username

    • iot.client.password

    For example:
    $maven/bin/mvn -Diot.client.username=your_username -Diot.client.password=your_password iotanalytics:sync