Hi, While the download instructions of ActiveMq[0] suggest including activemq-all in your pom.xml, this is actually a bad idea. See the discussion here on ticket AMQ-5009 [1]. The .jar is built using the Maven shade plugin, which directly dumps libraries in the classpath, without allowing usage of the Maven <exclude> directive.
If a project pulls in activemq-all, it now *has* to use the implementations of
all its libraries compiled into the jar, and cannot depend on them directly.
This is clearly not a good idea, and will indeed cause problems — for example
with SLF4J. If I write an application that depends on SLF4J for logging, and
uima-as-scaleout, the transitively pulled in activemq-all will cause a classpath
conflict for the SLF4J library. This problem is recorded in UIMA-3633 [2], but
the proposed fix does not work (as of version uima-as-activemq 2.6.0.) Nor
does it seem to be the appropriate fix, since depending on the Maven-shaded jar
could cause problems not only with SLF4J.
A better solution would be to depend on the activemq components separately. My
current workaround in my application's pom.xml reads like this:
…
<dependencies>
…
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-as-activemq</artifactId>
<version>2.6.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.7.0</version>
</dependency>
…
</dependencies>
Note that I probably will need to include more than just activemq-core.
While this *works* it should be clear, that it is not a very satisfactory
solution. I propose pre-empting the decision on AMQ-5009, and switching away
from the dependency on activemq-all, which in any case should not be depended
upon because of the way it dumps all _its_ dependencies in the classpath.
Regards,
Aleks
PS: I'm not subscribed to the dev-list, so if this is supposed to go there, I
could cross post it later, or you can feel free to cross-post it there.
---
[0] http://activemq.apache.org/activemq-5100-release.html (look for "Getting
the Binaries using Maven 2")
[1] https://issues.apache.org/jira/browse/AMQ-5009
[2] https://issues.apache.org/jira/browse/UIMA-3633
signature.asc
Description: Digital signature
