Create a Jar File

You need to make a jar file of your project that can be loaded by the agent platform.

Step 7: Create a Jar File

The EIS class loader that loads the environment interface on the agent platform side needs to know where it can find the main class that it should use to launch the interface. You can add this information to the project's pom file by adding the following section to the plugins section:

  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
          <archive>
              <manifest>
                  <addClasspath>true</addClasspath>
                  <mainClass>eisinterface.HanoiInterface</mainClass>
              </manifest>
          </archive>
      </configuration>

      <executions>
          <execution>
              <id>hanoi</id>
              <goals>
                  <goal>jar</goal>
              </goals>
              <phase>package</phase>
              <configuration>
                  <archive>
                      <manifest>
                          <addClasspath>true</addClasspath>
                          <mainClass>eisinterface.HanoiInterface</mainClass>
                      </manifest>
                  </archive>
                  <classifier>hanoi</classifier>
              </configuration>
          </execution>
      </executions>
  </plugin>

You'll need to replace eisinterface.helloworldinterface with the respective package and name of your main class. This (normally) is the class that extends AbstractEnvironment, which you've created in Step 4 and 5.

By running maven on this project, mvn install, it will generate the required jar file. This can be used to connect your agents to your environment.