Closed marcinkoziej closed 13 years ago
Hello. I want to write a task to delete some RabbitMQ queue. my tasks.clj file looks like this:
(require 'cake) (require '[org.clojars.rabbitmq :as rabbitmq]) (deftask delete-queue #{deps} "This task deletes queue from rabbitmq configured under (*project* :mq)" (let [[c ch] (rabbitmq/connect (cake/*project* :mq))] (.queueDelete ch (first (:delete-queue cake/*opts*))) ))
I use clojure-rabbitmq which in turns uses rabbitmq java api imported with:
(ns org.clojars.rabbitmq (:gen-class) (:import (com.rabbitmq.client ConnectionParameters Connection Channel AMQP ConnectionFactory Consumer QueueingConsumer)))
Running cake throws ClassNotFound exception: Exception in thread "main" java.lang.ClassNotFoundException: com.rabbitmq.client.ConnectionParameters (rabbitmq.clj:3)
The same dependencies work for my project - but they do not work when included in tasks.clj or in user.clj (for instance, if I want to ahve those deps automatically referenced in REPL)
my project.clj begins with:
(defproject transformer "0.1.0" :description "SQL-XSLT webapp engine" :dependencies [[clojure "1.2.0"] [clojure-contrib "1.2.0"] [postgresql "9.0-801.jdbc4"] [commons-io "1.4"] [commons-cli "1.2"] [com.rabbitmq/amqp-client "1.7.2"] [clojure-saxon "0.9.2"] [compojure "0.5.3"] ] :dev-dependencies [[swank-clojure "1.2.0"] [org.clojars.gjahad/debug-repl "0.3.0-SNAPSHOT"]] :main transformer.app.cmd)
(i use rabbitmq.clj of clojure-rabbitmq project copied directly in my src tree, so it's not present in :dependencies)
Best regards, I really appreciate Your work!
m.
hi,
sorry, i just realized i never responded to this. you need to use the 'bake' macro to run code in your project classloader.
take a look at src/cake/tasks/test.clj for an example.
cheers, :justin
Hello. I want to write a task to delete some RabbitMQ queue. my tasks.clj file looks like this:
I use clojure-rabbitmq which in turns uses rabbitmq java api imported with:
Running cake throws ClassNotFound exception: Exception in thread "main" java.lang.ClassNotFoundException: com.rabbitmq.client.ConnectionParameters (rabbitmq.clj:3)
The same dependencies work for my project - but they do not work when included in tasks.clj or in user.clj (for instance, if I want to ahve those deps automatically referenced in REPL)
my project.clj begins with:
(i use rabbitmq.clj of clojure-rabbitmq project copied directly in my src tree, so it's not present in :dependencies)
Best regards, I really appreciate Your work!
m.