Hi,
I use eclipse clojure & maven for developing applications. I have clojure maven plugin installed.
I start script with clojure:run goal. The script creates server socket. After i terminate script from
eclipse the socket is stil alive. When I start script again I got address already in use error.
Am I doing something wrong? Is there other way to start clojure script/program from maven?
P.S
This is may script :
(ns clojure.examples.example5)
(def server-socket (new ServerSocket 5432))
;Creates programs loop and prints message every second
(loop
[]
(println "server waits for a client")
(let [client-socket (.accept server-socket)]
(println "client accepted")
(recur)))
and this is may pom.xml file :
<modelVersion>4.0.0</modelVersion>
<groupId>com.amsi</groupId>
<artifactId>module-server</artifactId>
<version>0.1</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<script>src/clojure/examples/example5.clj</script>
</configuration>
<executions>
<execution>
<id>compile-clojure</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>clojure-releases</id>
</repository>
<repository>
<id>clojars</id>
</repository>
</repositories>
</project>