Closed cswarth closed 8 years ago
I fixed this issue by adding the appropriate <configuration>
directives to the pom.xml file. While I was at it, I also updated the build to use the latest version of the spark API (v2.5). I had to add an explicit dependency on slf4j-simple
or the app would fail at runtime due to lack of a logging implementation.
<?xml version="1.0" encoding="UTF-8"?>
<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>sparksocket</groupId>
<artifactId>sparksocket</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.j2html</groupId>
<artifactId>j2html</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Sorry about that, I left target out. I just pushed the change :) Edit: I guess I can migrate to 2.5 while we're at it.
Maven targets Java 1.5 by default, so this example that uses features of Java 1.8 is not going to compile. Did you have some settings in your
~/.m2/settings.xml
file that were not captured in this repo?