Skip to content

Instantly share code, notes, and snippets.

@pfdevmuller
Created March 12, 2015 20:25
Show Gist options
  • Save pfdevmuller/473d03765906f5e25791 to your computer and use it in GitHub Desktop.
Save pfdevmuller/473d03765906f5e25791 to your computer and use it in GitHub Desktop.
Corrected version of minimal Mindstorms EV3 Lejos pom from https://lejosev3.wordpress.com/2013/11/07/run-and-debug-java-code-with-eclipse/
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MavenRobot</groupId>
<artifactId>MavenRobot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>MavenRobot</name>
<description>This is an example maven project to run Java code one the EV3 brick</description>
<properties>
<brick.host>192.168.1.102</brick.host>
<brick.home>/home/root</brick.home>
<brick.user>root</brick.user>
<brick.debug.port>4000</brick.debug.port>
<project.main.class>MakeHurray</project.main.class>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>${project.main.class}</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="Push to server ${project.build.directory}/${project.build.finalName}*.jar"></echo>
<scp trust="yes" username="${brick.user}" password="" todir="root@${brick.host}:${brick.home}">
<fileset dir="${project.build.directory}">
<include name="${project.build.finalName}*.jar">
</include></fileset>
</scp>
</target>
</configuration>
</execution>
<execution>
<id>default-cli</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- SSH -->
<taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="maven.plugin.classpath"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath"/>
<!-- run the jar -->
<if>
<equals arg1="${debug}" arg2="true"/>
<then>
<sshexec host="${brick.host}" trust="yes" username="${brick.user}" password="" command="jrun -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${brick.debug.port},suspend=y -cp ${brick.home}/${project.build.finalName}-jar-with-dependencies.jar ${project.main.class}">
</sshexec>
</then>
<else>
<sshexec host="${brick.host}" trust="yes" username="${brick.user}" password="" command="jrun -cp ${brick.home}/${project.build.finalName}-jar-with-dependencies.jar ${project.main.class}">
</sshexec></else>
</if>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-commons-net</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>jsch</groupId>
<artifactId>jsch</artifactId>
<version>0.1.29</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>20020829</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>ev3classes</groupId>
<artifactId>ev3classes</artifactId>
<scope>compile</scope>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>3.2.7</version>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment