t0xa / gelfj

Graylog Extended Log Format (GELF) implementation in Java and log4j appender without any dependencies.
https://github.com/t0xa/gelfj/wiki
Other
186 stars 116 forks source link

RabbitMQ client should be an optional dependency #68

Closed agentgt closed 10 years ago

agentgt commented 10 years ago

In the pom.xml for the RabbitMQ client dependency I believe it can be and should be optional:

    <dependency>
        <groupId>com.rabbitmq</groupId>
        <artifactId>amqp-client</artifactId>
        <version>3.0.4</version>
        <optional>true</optional>
    </dependency>

Notice the <optional>true</optional>.

As long as GelfAMQPSender is not instantiated (which would be the case if you did not use AMQP) I believe everything will be fine (ie no class missing exceptions).

t0xa commented 10 years ago

Hi Adam,

I pushed the change into master branch. I'll try to integrate your pull request and look into another issue before making a release.

Do you know how to do same thing in Gradle?

Thanks, Anton

agentgt commented 10 years ago

I think in gradle you would change this:

compile "com.rabbitmq:amqp-client:3.0.4"

to

optional "com.rabbitmq:amqp-client:3.0.4"

I didn't find this in the gradle doc but rather the springframework build.

However I tried the above and even tried using Springs gradle plugins (see at the top of their build.gradle: using prodeps plugin ) and apparently it doesn't work for my version of gradle (1.10) so I'm not sure.

However as long as the published pom.xml has it as optional then that should be fine.