Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit dependency should be excluded #104

Closed
dsyer opened this issue Feb 19, 2017 · 5 comments
Closed

JUnit dependency should be excluded #104

dsyer opened this issue Feb 19, 2017 · 5 comments
Assignees

Comments

@dsyer
Copy link

dsyer commented Feb 19, 2017

Possibly some others (jline?). There are some really funky things on the classpath of a SCS Kafka app.

@mbogoevici
Copy link
Contributor

mbogoevici commented Feb 19, 2017

@dsyer Are you sure that they're brought in by the Kafka binder? Neither JUnit nor JLine are dependencies of it (it's easy to prove that with an Initializr generated app, which I just did, locally).

@dsyer
Copy link
Author

dsyer commented Feb 20, 2017

	<dependencies>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-stream-binder-kafka</artifactId>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>Camden.BUILD-SNAPSHOT</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
$ mvn dependency:list -Dsort
...
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:list (default-cli) @ kafka ---
[INFO] 
[INFO] The following files have been resolved:
[INFO]    ch.qos.logback:logback-classic:jar:1.1.9:compile
[INFO]    ch.qos.logback:logback-core:jar:1.1.9:compile
[INFO]    com.101tec:zkclient:jar:0.7:compile
[INFO]    com.esotericsoftware:kryo-shaded:jar:3.0.3:compile
[INFO]    com.esotericsoftware:minlog:jar:1.3.0:compile
[INFO]    com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO]    com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile
[INFO]    com.fasterxml.jackson.core:jackson-databind:jar:2.8.6:compile
[INFO]    com.fasterxml:classmate:jar:1.3.3:compile
[INFO]    com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO]    com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO]    com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO]    io.netty:netty:jar:3.7.0.Final:compile
[INFO]    javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO]    jline:jline:jar:0.9.94:compile
[INFO]    junit:junit:jar:4.12:compile
[INFO]    net.jpountz.lz4:lz4:jar:1.2.0:compile
[INFO]    net.minidev:accessors-smart:jar:1.1:test
[INFO]    net.minidev:json-smart:jar:2.2.1:test
[INFO]    net.sf.jopt-simple:jopt-simple:jar:3.2:compile
[INFO]    org.apache.kafka:kafka-clients:jar:0.9.0.1:compile
[INFO]    org.apache.kafka:kafka_2.11:jar:0.9.0.1:compile
[INFO]    org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:compile
[INFO]    org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:compile
[INFO]    org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.11:compile
[INFO]    org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO]    org.assertj:assertj-core:jar:2.6.0:test
[INFO]    org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO]    org.hamcrest:hamcrest-library:jar:1.3:test
[INFO]    org.hibernate:hibernate-validator:jar:5.3.4.Final:compile
[INFO]    org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
...

@mbogoevici
Copy link
Contributor

mbogoevici commented Feb 20, 2017

@dsyer

I stand corrected on JLine - it is brought in by ZK (which we need - I guess we can exclude JLine in particular. It would be much simpler if you just excluded org.apache.kafka:kafka_2.11:jar:0.9.0.1:compile from the app (which suppresses provisioning).

JUnit, which the original issue was about, is a rather odd story there:

mvn dependency:tree points back to junit as as a transitive dependency of spring-boot-starter-test.

09:16 $ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ demo ---
[INFO] com.example:demo:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.cloud:spring-cloud-stream-binder-kafka:jar:1.1.2.BUILD-SNAPSHOT:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-stream:jar:1.1.2.BUILD-SNAPSHOT:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-actuator:jar:1.4.4.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot-starter:jar:1.4.4.RELEASE:compile
[INFO] |  |  |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.4.RELEASE:compile
[INFO] |  |  |  |  |  +- ch.qos.logback:logback-classic:jar:1.1.9:compile
[INFO] |  |  |  |  |  |  \- ch.qos.logback:logback-core:jar:1.1.9:compile
[INFO] |  |  |  |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.22:compile
[INFO] |  |  |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.22:compile
[INFO] |  |  |  |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.22:compile
[INFO] |  |  |  |  \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] |  |  |  \- org.springframework.boot:spring-boot-actuator:jar:1.4.4.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-web:jar:1.4.4.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.4.RELEASE:compile
[INFO] |  |  |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:compile
[INFO] |  |  |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.11:compile
[INFO] |  |  |  +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] |  |  |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] |  |  |  |  \- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.6:compile
[INFO] |  |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile
[INFO] |  |  |  +- org.springframework:spring-web:jar:4.3.6.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-webmvc:jar:4.3.6.RELEASE:compile
[INFO] |  |  |     \- org.springframework:spring-expression:jar:4.3.6.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-validation:jar:1.4.4.RELEASE:compile
[INFO] |  |  |  \- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:compile
[INFO] |  |  +- org.springframework:spring-messaging:jar:4.3.6.RELEASE:compile
[INFO] |  |  |  +- org.springframework:spring-beans:jar:4.3.6.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-context:jar:4.3.6.RELEASE:compile
[INFO] |  |  +- org.springframework.integration:spring-integration-core:jar:4.3.7.RELEASE:compile
[INFO] |  |  |  +- org.springframework:spring-aop:jar:4.3.6.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-tx:jar:4.3.6.RELEASE:compile
[INFO] |  |  +- org.springframework.integration:spring-integration-jmx:jar:4.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-tuple:jar:1.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.integration:spring-integration-tuple:jar:1.0.0.RELEASE:compile
[INFO] |  |  \- org.springframework.retry:spring-retry:jar:1.1.5.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-stream-codec:jar:1.1.2.BUILD-SNAPSHOT:compile
[INFO] |  |  +- com.esotericsoftware:kryo-shaded:jar:3.0.3:compile
[INFO] |  |  |  \- com.esotericsoftware:minlog:jar:1.3.0:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.6:compile
[INFO] |  +- org.springframework.integration:spring-integration-kafka:jar:2.0.1.RELEASE:compile
[INFO] |  +- org.apache.kafka:kafka_2.11:jar:0.9.0.1:compile
[INFO] |  |  +- com.101tec:zkclient:jar:0.7:compile
[INFO] |  |  +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] |  |  +- org.scala-lang.modules:scala-xml_2.11:jar:1.0.4:compile
[INFO] |  |  +- org.scala-lang:scala-library:jar:2.11.7:compile
[INFO] |  |  +- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] |  |  +- net.sf.jopt-simple:jopt-simple:jar:3.2:compile
[INFO] |  |  \- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] |  |     +- jline:jline:jar:0.9.94:compile
[INFO] |  |     \- io.netty:netty:jar:3.7.0.Final:compile
[INFO] |  +- org.apache.kafka:kafka-clients:jar:0.9.0.1:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.22:compile
[INFO] |  |  +- org.xerial.snappy:snappy-java:jar:1.1.1.7:compile
[INFO] |  |  \- net.jpountz.lz4:lz4:jar:1.2.0:compile
[INFO] |  \- org.springframework.kafka:spring-kafka:jar:1.0.5.RELEASE:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.4.4.RELEASE:test
[INFO]    +- org.springframework.boot:spring-boot-test:jar:1.4.4.RELEASE:test
[INFO]    |  \- org.springframework.boot:spring-boot:jar:1.4.4.RELEASE:compile
[INFO]    +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.4.RELEASE:test
[INFO]    |  \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.4.RELEASE:compile
[INFO]    +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO]    |  \- net.minidev:json-smart:jar:2.2.1:test
[INFO]    |     \- net.minidev:accessors-smart:jar:1.1:test
[INFO]    |        \- org.ow2.asm:asm:jar:5.0.3:test
[INFO]    +- junit:junit:jar:4.12:compile
[INFO]    +- org.assertj:assertj-core:jar:2.5.0:test
[INFO]    +- org.mockito:mockito-core:jar:1.10.19:test
[INFO]    |  \- org.objenesis:objenesis:jar:2.1:compile
[INFO]    +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO]    +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO]    +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO]    |  \- org.json:json:jar:20140107:test
[INFO]    +- org.springframework:spring-core:jar:4.3.6.RELEASE:compile
[INFO]    \- org.springframework:spring-test:jar:4.3.6.RELEASE:test

Oddly enough, the change of scope of JUnit (from test to compile) does change only when spring-cloud-stream-binder-kafka is added to the project (and only for Camden, but not for Dalston).

However, if only spring-cloud-stream-binder-kafka is added to the project, then there's no JUnit dependency.

So we need to find out what changes the scope of JUnit in this scenario.

@dsyer
Copy link
Author

dsyer commented Feb 20, 2017

It's jline that brings in junit in compile scope:

...
[INFO]    |  +- net.sf.jopt-simple:jopt-simple:jar:3.2:compile
[INFO]    |  \- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO]    |     +- jline:jline:jar:0.9.94:compile
[INFO]    |     |  \- junit:junit:jar:4.12:compile
[INFO]    |     |     \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO]    |     \- io.netty:netty:jar:3.7.0.Final:compile
...

(and that comes in with just the binder).

@mbogoevici
Copy link
Contributor

mbogoevici commented Feb 20, 2017

@dsyer thanks :) and that happens only for version 3.4.6, which is why this is not happening for Dalston (and I didn't notice it while I was swapping between Camden and Dalston). We can safely exclude jline from both master and 1.1.x branches then.

mbogoevici added a commit to mbogoevici/spring-cloud-stream-binder-kafka that referenced this issue Feb 20, 2017
@mbogoevici mbogoevici removed their assignment Feb 20, 2017
@mbogoevici mbogoevici removed the in pr label Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants