/  Yamcs Maven Plugin  /  Examples  /  Yamcs Plugin

Yamcs PluginΒΆ

Writing a Yamcs plugin is just like writing any other jar. Declare your dependencies to the desired Yamcs artifacts, and define the Java version that you want to comply with. Official Yamcs plugins strive to remain compatible with Java 8 language features for the foreseeable future, but you are free to use more recent Java version in your project if you can.

To prototype your plugin in a local Yamcs application, add the yamcs-maven-plugin to the plugins section. Once you have specified a valid configuration in src/main/yamcs/, you can get your copy of Yamcs running with:

mvn yamcs:run

To package your Yamcs plugin, simply do mvn package. The resulting jar artifact can be dropped in the lib/ or lib/ext/ folder of any compatible Yamcs server.

For optimal integration we recommend adding an execution of the yamcs:detect mojo as shown below. It will allow Yamcs to find metadata on your plugin and will give your plugin the opportunity to hook into the lifecycle of Yamcs.

<project>
  ...
  <packaging>jar</packaging>

  <properties>
    <yamcsVersion>4.10.9</yamcsVersion>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.yamcs</groupId>
      <artifactId>yamcs-core</artifactId>
      <version>${yamcsVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.yamcs</groupId>
      <artifactId>yamcs-web</artifactId>
      <version>${yamcsVersion}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.yamcs</groupId>
        <artifactId>yamcs-maven-plugin</artifactId>
        <version>1.2.2-SNAPSHOT</version>
        <executions>
          <execution>
            <goals>
              <goal>detect</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>